|
|
 |
RE: FN-FORUM: sql question
date posted 7th August 2004 14:10
Hi Pam
AS your questions in the past have been MS SQL I assume that's what you are
using
The best way to handle dates is as a DateTime or SamllDateTime field in the
database, then you can use between and >= statements etc.
As they are varchar then use CONVERT ( DateTime , expression , 3)
3 is British style with 2 digit year (103 for 4 digit year)
The style is very important, especially if you have a non UK locale server.
SQL Server is very prone to try to store dates in US format and you can get
strange results (30/06/02 it knows is June but 05/06/02 it might take as
being May). I tend to, if I can pass dates in 06 June 2004 format, probable
not quite as efficient but I know the correct date will be stored
Damon
-----Original Message-----
From: [EMAIL REMOVED] [EMAIL REMOVED] On Behalf Of PAMELA
WHITTAKER
Sent: 07 August 2004 13:06
To: FN-FORUM / [EMAIL REMOVED]
Subject: FN-FORUM: sql question
I have a date stored as dd/mm/yy as a vchar in an sql database. How do I
write an sql statement to select a date range? Is there some way of
converting it to a date format in the select statement?
Thanks
Pam
|
 |
|