Re: variables and select from events table
2002-07-19 10:02:49
I always use things like
where (cast((current_timestamp-backup_end)day as decimal(18,0))>2)
and you could always throw in something like
where (cast((current_timestamp-backup_end)day as decimal(18,0))>2 and
cast((current_timestamp-backup_end)day as decimal(18,0))<7 )
to narrow it down within a date range...
but you can "cast" the scheduled_start as variable character length 19 to
get what you want...
cast(scheduled_start as varchar(19) )
Oh, but that might not compare like you want...
converting it to a character string and doing the compare
which gets back to why I do differences as outlined above.
You can also try to break the date out with
date(scheduled_start) and you can do some comparison like
date(scheduled_start)='MM/DD/YYYY'
and break the time out with
time(scheduled_start) and compare like
time(scheduled_start)=' HH:MM:SS'
anyway, these all work to get different components of date_time fields...
Dwight
|
|
|