Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PostgreSql + Date Format Convert YYYY-MM-DD to Day, Date Month Year

Suppose I am storing this format in my postgre database table. Now I have to compare this date with one of the texbox value contain date in different format.

Database Date Format :: YYYY-MM-DD For example :: 2010-11-26

Text-Field Date Format :: Day, Month Date, Year :: Fri, Nov 26, 10

Now I have tried to compare this value but no response Plz suggest.

    Select * from table_name where user_id=('11') 
and to_char(effective_date, $$$$$$$$)=trim('Fri, Nov 26, 10');

Now Plz suggest which format should I use in place of $$$$$$$$ ???

Thanks !!!

like image 503
Rubyist Avatar asked Nov 26 '10 16:11

Rubyist


1 Answers

SELECT 
  * 
FROM 
  table_name 
WHERE 
  user_id=('11') 
AND 
  to_char(effective_date, 'Dy, Mon DD, YY') = trim('Fri, Nov 26, 10');
like image 162
Frank Heikens Avatar answered Sep 21 '22 03:09

Frank Heikens