Guest_imported
New member
- Jan 1, 1970
- 0
I have an SP which has a date as a variable.
I want to test for either 0 or CCYYMMDD (ie 20011105).
The date in the table which is to be matched is defined as
numeric, & can either be zero, or CCYYMMDDHHMMSS.
I have written
substring(convert(char(16),<tabledate>),1,8) = @date
but this doesnt' work for zero.
I have also tried convert(numeric(@date)) but this doesn't work either.
Can anyone give me the code please ?
PS The DB is SYBASE.
Many thanks
I want to test for either 0 or CCYYMMDD (ie 20011105).
The date in the table which is to be matched is defined as
numeric, & can either be zero, or CCYYMMDDHHMMSS.
I have written
substring(convert(char(16),<tabledate>),1,8) = @date
but this doesnt' work for zero.
I have also tried convert(numeric(@date)) but this doesn't work either.
Can anyone give me the code please ?
PS The DB is SYBASE.
Many thanks