Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread select by date (+30 Seconds)
Fri, Feb 13 2009 2:39 AMPermanent Link

Garey
hi,guys ,pls help..

How to select by  date(+30 Seconds)


Regards
Garey
Fri, Feb 13 2009 3:37 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Garey


I had written an answer but then I came up with a few other scenarios as to what you were trying to achieve and realised I didn't know just what you need help with.

Date + 30 seconds means a TIMESTAMP so are you selecting against a timestamp field and you want everything after a certain day or.....

To add 30 seconds to the current date in sql try

CAST(CAST(CURRENT_DATE AS CHAR(10)) +' 00:00:30.00' AS TIMESTAMP)

Roy Lambert [Team Elevate]
Fri, Feb 13 2009 4:27 AMPermanent Link

Garey
Roy Lambert wrote:

Garey


I had written an answer but then I came up with a few other scenarios as to what you were trying to achieve and realised I didn't know just what you need help
with.

Date + 30 seconds means a TIMESTAMP so are you selecting against a timestamp field and you want everything after a certain day or.....

To add 30 seconds to the current date in sql try

CAST(CAST(CURRENT_DATE AS CHAR(10)) +' 00:00:30.00' AS TIMESTAMP)

Roy Lambert [Team Elevate]


hi Roy,many many thank...
Fri, Feb 13 2009 4:59 AMPermanent Link

"John Hay"
> CAST(CAST(CURRENT_DATE AS CHAR(10)) +' 00:00:30.00' AS TIMESTAMP)

or

cast(current_date as timestamp)+30000   Smiley


John

Fri, Feb 13 2009 5:04 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

John


I can never remember which uses milliseconds past midnight and which a fraction of a 24 hour day (I think this is TDateTime) so I'm playing safe.

Roy Lambert
Image