Whing Dela Cruz
asked on
Accessing sql data with datetime
Hi experts, I have a problem obtaining data in sqlserver in which in my sql command I need to advance 1 day of my time end before able to obtain the data. My data field in sql is look like this, "2017-08-17 10:00:00.000" this means that it has a time and this is August 17, 2017. In my sql command I cannot obtain this record if i set the time end to "08/17/2017" but "08/18/2017" meaning i need to advance 1 day. Is there anyone who can explain me why. What shall i do to make my sql command set "08/17/2017"?
Set rs = cn.Execute("Select Proname, TheDate, from sTable where TheDate Between '" & "08/17/2017" & "' And '" & "08/17/2017") & ")
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Great solution, very smart!
ASKER