J
Justin Emlay
I'm trying to select from an Access DB based on a date field. The date
field in Access is specified as Date/Time and the following code is grabbing
the date from a DatePicker in short format:
Error - Date type mismatch in criteria expression
Dim PeriodStart As Date = dpTSPeriodStart.Text
DsTimeSheets1.Clear()
DaTimeSheets.SelectCommand.CommandText = "SELECT [Job Date], Employee, [Job
Number], [Reg Hours], [Over Hours], [Vac Hours], [Hol Hours], [Period
Start], [Date Entered], ID FROM TimeSheets WHERE [Period Start] = '" &
PeriodStart & "'"
The date in the DB is "6/27/2004" and not "06/27/2004" and the following
doesn't work either:
Format$(PeriodStart, "MM/dd/yy")
I'd appreciate any insight,
Thanks,
Justin
field in Access is specified as Date/Time and the following code is grabbing
the date from a DatePicker in short format:
Error - Date type mismatch in criteria expression
Dim PeriodStart As Date = dpTSPeriodStart.Text
DsTimeSheets1.Clear()
DaTimeSheets.SelectCommand.CommandText = "SELECT [Job Date], Employee, [Job
Number], [Reg Hours], [Over Hours], [Vac Hours], [Hol Hours], [Period
Start], [Date Entered], ID FROM TimeSheets WHERE [Period Start] = '" &
PeriodStart & "'"
The date in the DB is "6/27/2004" and not "06/27/2004" and the following
doesn't work either:
Format$(PeriodStart, "MM/dd/yy")
I'd appreciate any insight,
Thanks,
Justin