Home > Blockchain >  postgressql insert a date funciton
postgressql insert a date funciton

Time:09-21

I keep trying to reformat this date to get it to accept it. I have tried everything. Any help would be appreicated. Thank you

INSERT INTO well.production_monthly(
    api10, prod_date,  oil, gas, water)
    VALUES (4246141341,02/01/2012, 102, 27, 0);

Error ERROR: column "prod_date" is of type date but expression is of type integer LINE 3: VALUES (4246141341,02/01/2012, 102, 27, 0); ^ HINT: You will need to rewrite or cast the expression. SQL state: 42804 Character: 95

CodePudding user response:

I do not have easy postgressql database just at the moment. But a google search seems to show it is the same as SqlServer, that is to say (the single quotes are part of it ''):

'YYYY-MM-DD' '2012-01-02'

Including Time: 'YYYY-MM-DD HH:mm:ss.[fractions of a second]' '2012-01-02 23:59:59.999'

Between single quotes, the number descends in value From Year to Month, to Day, to Hour, to Minute, to Seconds, to Fractions of a Second.

  • Related