dejandejanovic
asked on
How to store only time into MSaccess database?
Hello,
I have an application with Access database. In database I need to query records between ONLY times.
I have in vb.net code on Button_click like this:
How can I get only time?
My goal is to query like. But, of course it is not working, because the Date is also include.
Thank you in advance for help to anyone.
I have an application with Access database. In database I need to query records between ONLY times.
I have in vb.net code on Button_click like this:
OnlyTimeTextBox.text = TimeString
But, when I save record, then database get value like 13.3.2011 19:05:10.How can I get only time?
My goal is to query like. But, of course it is not working, because the Date is also include.
Between #7:00:00# and #8:00:00#
Thank you in advance for help to anyone.
Forgot the comma
datepart("hh",YourDateFiel d)
datepart("hh",YourDateFiel
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It works perfect. I could not remember for this solution.
Thank you AkAlan.
This is Access version of the AkAlan code, if someone else maybe need it:
[code]DatePart("h";[YourDa teField])[ /code]
Thank you AkAlan.
This is Access version of the AkAlan code, if someone else maybe need it:
[code]DatePart("h";[YourDa
ASKER
DatePart("h";[YourDateField])
where datepart("hh"YourDateField
you may have to play with parenthasis and pound sign