Groups | Blog | Home
all groups > sql server mseq > october 2005 >

sql server mseq : Selecting by date


Stan
10/27/2005 2:46:02 PM
I have a table that has the significant date set up as a CHAR datatype with
length of 8, i.e 20051027. I want to select all transactions where this date
equals the system date.
--
Hugo Kornelis
10/27/2005 11:53:24 PM
[quoted text, click to view]

Hi Stan,

SELECT ....
FROM ....
WHERE YourDateColumn = CONVERT(char(8), CURRENT_TIMESTAMP, 112)

But why are you storing a date as a CHAR column, instead of using the
datetime datatype?

Best, Hugo
--

Stan
10/28/2005 5:28:02 AM
Hugo,
I agree about the improper storing of date data. This field is in a
database that is part of a purchased software package and designed by a
software vendor believe it or not.
--
Stan Gosselin


[quoted text, click to view]
Hugo Kornelis
10/28/2005 9:56:47 PM
[quoted text, click to view]

Hi Stan,

O, I believe it. I am long past the days where I expected expensive
software to be better than cheap software. :-(

Best, Hugo
--

AddThis Social Bookmark Button