My table contains a [time] field that is a DateTime variable with the type 2014-04-08 23:55:00.000. I want to choose every record that occurred between two particular hours and dates.
Like this:
SELECT * FROM [table]
WHERE time >=2014-04-08 23:53:00.000 AND time <= 2014-04-08 23:58:00.000
I wrote a SQL query:
SELECT * FROM [table]
WHERE time BETWEEN #4/19/2014 12:00:00 AM# and #4/19/2014 12:30:00 AM#
But it's giving me this error:
Incorrect syntax near '12'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Can someone help me solve this?