pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
dates and selection
2+ messages / 2 participants
[nested] [flat]

* dates and selection
@ 2005-08-18 20:36  Joel Fradkin <jfradkin@wazagua.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Joel Fradkin @ 2005-08-18 20:36 UTC (permalink / raw)
  To: pgsql-odbc@postgresql.org; pgsql-sql

After my conversion to Unicode and implementing new drivers (Thank god still
up no down time :-)) I do have an issue with some of my sql selects
concerning dates.

 

I know the long answer, but am asking if there is a short one.

 

I have in some of my slq :

(to_char(e.incidentdate, 'Mon DD YYYY'::text) || ' '::text) ||
e.incidenttime::text  as incidentdate

 

I used to be able to sort and select by incident date and it was working ok
(I think).

 

Now I found I had to do something like this just to have a timestamp
(problem is I do not want the format of the time stamp, my clients want to
see the month as a string)

((to_char(e.incidentdate, 'Mon DD YYYY'::text) || ' '::text) ||
e.incidenttime::text)::timestamp  as datetoselectby

 

Is there any way to reference the text type variable as a date selection?
(was this ever working or was I hallucinating).

 

Many thanks for all the help.

 

Joel Fradkin

 

 

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: dates and selection
@ 2005-08-19 04:18  Josh Berkus <josh@agliodbs.com>
  parent: Joel Fradkin <jfradkin@wazagua.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Josh Berkus @ 2005-08-19 04:18 UTC (permalink / raw)
  To: pgsql-sql; +Cc: Joel Fradkin <jfradkin@wazagua.com>

Joel,

> Now I found I had to do something like this just to have a timestamp
> (problem is I do not want the format of the time stamp, my clients want to
> see the month as a string)

Um, what's wrong with:

to_char(some_timestamp, 'Mon DD YYYY HH:MI:SS') 

?

-- 
Josh Berkus
Aglio Database Solutions
San Francisco



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2005-08-19 04:18 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-08-18 20:36 dates and selection Joel Fradkin <jfradkin@wazagua.com>
2005-08-19 04:18 ` Josh Berkus <josh@agliodbs.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox