Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

SQL query syntax for date range

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

2 REPLIES
Cisco Employee

Re: SQL query syntax for date range

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"

New Member

Re: SQL query syntax for date range

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.

345
Views
0
Helpful
2
Replies