2

I'm using Posture and I got error message "invalid input syntax for type timestamp with time zone" when using the following select code:

SELECT * FROM public."table1" WHERE 'registrationTimestamp' BETWEEN 
to_timestamp('22-10-2013 00:00', 'DD-MM-YYYY HH24:MI')
AND to_timestamp('22-10-2013 23:59', 'DD-MM-YYYY HH24:MI')**

While registrationTimestamp timestamp format is like following:

6/26/2012 6:43:10 PM
Milen A. Radev
63.1k22 gold badges111 silver badges112 bronze badges
asked Oct 30, 2013 at 11:55
1
  • 1
    if registrationTimestamp is a column, it does not have a format. Datatypes don't have formats in SQL. Commented Oct 30, 2013 at 12:02

1 Answer 1

1

There is wrong using of apostrophes

Should be

SELECT * FROM public."table1" 
 WHERE "registrationTimestamp" BETWEEN 
 to_timestamp('22-10-2013 00:00', 'DD-MM-YYYY HH24:MI')
 AND to_timestamp('22-10-2013 23:59', 'DD-MM-YYYY HH24:MI')
answered Oct 30, 2013 at 12:11
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.