Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SPT date syntax
Message
 
 
To
28/02/2000 07:45:12
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00338332
Message ID:
00338339
Views:
17
In SQL Server, dates are stored as datetimes so if you are looking for a specific date, you either have to specify the entire value (date + time) or convert it into something manageable. The following can be used in your where clause:

WHERE convert(varchar(10),datetime_field,101) like "02/28/2000"

First parameter - type of value to convert to (in this case 10 character string)
Second parameter - field to convert
Third parameter - Style to convert to 1 - American, 2 - ANSI, 3 - British/French
Add 100 to value if you four digit year (as I have done)

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform