Jump to content

SQL Query


Nick55
 Share

Recommended Posts

Hi,

I'm creating some widgets, Id like to view tickets logged yesterday. 

Today is current_date

Should yesterday be something like subdate(current_Date, 1) ?
Cant seem to get this to work.

Thanks

Link to comment
Share on other sites

Hi @Nick55

There are various ways of doing it, but to use the example that you gave, you could try:

h_datelogged >= subdate(current_date, 1) and h_datelogged < subdate(current_date,0)

I've tested this and it appears to bring back the correct number of results based on the requests I logged yesterday. 

Hope this helps

Bob

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...