SQL query syntax for date range

Unanswered Question
Oct 6th, 2009

Hello, I'm trying to write a query against CUCM6.1.2 that will give me all calls made to an extension for an inclusive range of dates. I want to say give me all calls made to extension "Z" for an example between September 9th and October 1st.

Here is what I was thinking would do it but it didn't and I've tried a bunch of things with no success:

run sql select callingpartynumber, originalcalledpartynumber, finalcalledpartynumber, duration, datetimestamporigination, datetimestampdisconnect from car:tbl_billing_data where datetimestamporigination > '2009-09-10' and finalcalledpartynumber IN ('3321')

Thanks in advance.

John

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Dennis Fogler Tue, 10/06/2009 - 08:00

John,

You can certainly use the syntax

SELECT * FROM db_table

WHERE date >= "1-SEP-2009"

AND date <= "5-SEP-2009" as an example.

I usually use the BETWEEN command

SELECT * FROM db_table

WHERE date BETWEEN "1-SEP-2009"

AND "5-SEP-2009"

j.mccartney Tue, 10/06/2009 - 11:15

Thanks for the response, I tried what you listed and it didn't work. I tried modifying the syntax based on known working query's but still not having any luck. I'll keep on trying. Thanks again for helping.

Actions

This Discussion