I am using SQL via the ODBC Connector to pull data from Remedy. I am
attermpting to pull from a join form that joins SRM:Survey and HPD:Help
Desk, however I have had the same issues attempting to pull directly from
HPD:Help Desk as well. Here is a sample of the query I am attempting to run:

SELECT     Assigned_Group, Assignee, Categorization_Tier_1,
Categorization_Tier_2, Categorization_Tier_3, Comment_1, Comment_2,
Comment_3, Comment_4, 
                      Company, Create_date2, Department, Description,
Detailed_Decription, First_Name, Group_Transfers, Incident_Number,
Individual_Transfers, 
                      Last_Name, Modified_date, Original_Incident_Number,
Priority, Product_Categorization_Tier_1, Product_Categorization_Tier_2, 
                      Product_Categorization_Tier_3, Question_1_Rating,
Question_2_Rating, Question_3_Rating, Question_4_Rating, Re_Opened_Date,
Request_ID, 
                      Resolution, Service_Type, Site, Status_, Submit_Date,
Submitted_By2, Survey_ID, Total_Transfers
FROM         SAGE_RQC_SurveyReporting
WHERE     (Create_date2 >= getdate())

This produces an error "expected lexical element not found". If I replace
getdate() with an actual date i.e. '9/1/2009', it changes this to { ts
'2009-09-01 00:00:00' }) and the query runs succesfully. 

What I am trying to accomplish is an automated export of this data that can
be scheduled to run at certain intervals - so I need to be able to use the
GETDATE function along with DATEADD and DATEDIFF functions to calculate the
time frame and use that as a comparison to the Create Date from the Remedy
data to pull those records that fall within the date range. How is this
accomplished using the ODBC connector? I have done multiple internet
searches and tried several methods, including ODBC date functions such as
CURRENT_DATE, CURDATE, etc and continue to get the "lexical element not
found" error. Is there a way to accomplish what I want within SQL using the
ODBC connector?

Please note that I am NOT using SQL against the Remedy backend SQL Server -
I am using the ODBC connector, so it does not appear I need to do the date
conversion functionsm, although I tried those as well with no success.


-- 
View this message in context: 
http://www.nabble.com/SQL-Date-Comparison-Using-ODBC-Connector-tp25296607p25296607.html
Sent from the ARS (Action Request System) mailing list archive at Nabble.com.

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor:[email protected] ARSlist: "Where the Answers Are"

Reply via email to