Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to store time (not date) in SQL and query from VFP
Message
From
28/02/2008 19:48:26
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
How to store time (not date) in SQL and query from VFP
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01297626
Message ID:
01297626
Views:
116
Ok, it's not that late, but I am brain dead tonight :o)

I want to store time in a field in sql server (I don't need the date but I could ignore the date portion if it has to be a datetime). Examples:

12:30am
12:45am
01:10am
01:30pm

etc

Then, from VFP I want to query the table in sql and find any record whose time value is

where [timefield in sql server] is < = time()

in other words, if it is 1:20pm in VFP, then I should retrieve records 1-3 above.

What type of field do I create in sqlserver and what type of field in VFP should I map to it and is the query a crazy one?

Note: the user will be selecting a time from a dropdown combobox built from an array (text field character e.g. 12:30am, 01:00am, et al) in vfp that they can edit to create 12:45pm for example) and then I need to convert what they select or enter and store that value in sql server to query later)
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Next
Reply
Map
View

Click here to load this message in the networking platform