Dates/Timestamps in a where clause

Started by Ian deSouzaabout 25 years ago3 messagesgeneral
Jump to latest
#1Ian deSouza
iandesouza@earthlink.net

Anybody know how to format a date/timestamp type in a where clause. ie.

where OrderDate='1996-07-17 00:00:00.0'

Thanks, Ian

#2Ian deSouza
iandesouza@earthlink.net
In reply to: Ian deSouza (#1)
Re: Dates/Timestamps in a where clause

Specifically, I'm working in Java and have a java.sql.Timestamp object and
want to formulate a where clause.

Ian

"Ian deSouza" <iandesouza@earthlink.net> wrote in message
news:nxje6.2897$ln1.234485@newsread2.prod.itd.earthlink.net...

Show quoted text

Anybody know how to format a date/timestamp type in a where clause. ie.

where OrderDate='1996-07-17 00:00:00.0'

Thanks, Ian

#3Einar Karttunen
ekarttun@cs.Helsinki.FI
In reply to: Ian deSouza (#1)
Re: Dates/Timestamps in a where clause

On Thu, 1 Feb 2001, Ian deSouza wrote:

Anybody know how to format a date/timestamp type in a where clause. ie.

where OrderDate='1996-07-17 00:00:00.0'

You could try changing the datestyle before the query.
SET DATESTYLE ISO|SQL|Postgres|German ...
You can read more from
http://www.fr.postgresql.org/docs/postgres/sql-set.htm

- Einar Karttunen