#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    2
    Rep Power
    0

    How to Declare DateTime


    how can i can change this sql code into postgres code:
    DECLARE @startDate datetime
    SET @startDate = '20090601'
    thanks
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1046
    Hi,

    Assuming you use a PL/pgSQL function, you'd have to put this in the DECLARE part:
    Code:
    start_date timestamp := '2009-6-1';

IMN logo majestic logo threadwatch logo seochat tools logo