SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 timestamp comparions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

oldest
Starting Member

South Africa
2 Posts

Posted - 04/29/2014 :  14:41:12  Show Profile  Reply with Quote
I am trying to run the following command:
"delete from invoice_log where now()-time > 120*60*60*24;"

and I get:

ERROR: operator does not exist: interval > integer
LINE 1: delete from invoice_log where now()-time > 120*60*60*24;
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

so my formats both side of the comparison do not match. Can anybody pls. help me to improve that statement. Thank you ^

khtan
In (Som, Ni, Yak)

Singapore
17650 Posts

Posted - 04/29/2014 :  22:31:04  Show Profile  Reply with Quote
Are you using Microsoft SQL Server ?


KH
Time is always against us

Go to Top of Page

oldest
Starting Member

South Africa
2 Posts

Posted - 04/30/2014 :  02:21:06  Show Profile  Reply with Quote
no, we ae using postgres..... but this is a sql syntax problem, which is not necessarily platform dependent. I have to troubleshoot a production site that somebody set up many years ago,
Cheers
Felix

quote:
Originally posted by khtan

Are you using Microsoft SQL Server ?


KH
Time is always against us



Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17650 Posts

Posted - 04/30/2014 :  02:38:58  Show Profile  Reply with Quote
quote:
but this is a sql syntax problem

it might be, but the function etc are not the same. There isn't now() in SQL Server.

You will get better help if you post in a Progres forum


KH
Time is always against us

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000