Hi.
Quickly just chucking together a SQL statement to pull out some data for a friend. He has an access database and the field in particular is a 'date/time' field. The format of the data looks like this: '28/03/2006 22:10:38'.
I quickly chucked onto my ASP page a SQL statement using DATEPART, so it looks something like:
I receive the error 'Too few parameters. Expected 3.'.
Any other recommendations or have I just made a SQL syntax error?
Thanks
- FateFirst
Quickly just chucking together a SQL statement to pull out some data for a friend. He has an access database and the field in particular is a 'date/time' field. The format of the data looks like this: '28/03/2006 22:10:38'.
I quickly chucked onto my ASP page a SQL statement using DATEPART, so it looks something like:
Code:
SELECT field_id, field_date
FROM table
WHERE (DATEPART(""yyyy"", timesheet_start_datetime) = '" & Year(Now()) & "' AND DATEPART(""m"", timesheet_start_datetime) = '" & Month(Now()) & "' AND DATEPART(""d"", timesheet_start_datetime) = '" & Day(Now()) & "')
I receive the error 'Too few parameters. Expected 3.'.
Any other recommendations or have I just made a SQL syntax error?
Thanks
- FateFirst