Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expected lexical element not found: =, <>, <, <=, >, or >=

Status
Not open for further replies.

dcmartin

Programmer
Aug 9, 2001
1
CA
Hi there,

My problem has to do with date comparisons using alias tables found in a database view. The error it returns is:

Expected lexical element not found: =, <>, <, <=, >, or >=

Here is my SQL. Any help would be greatly appreciated. Thank you.

SELECT HPD_HelpDesk.&quot;Arrival Time&quot; AS ARRIVAL_TIME, HPD_HelpDesk.&quot;Assign Time&quot; AS ASSIGN_TIME, HPD_HelpDesk.&quot;Case ID+&quot; AS CASE_ID, HPD_HelpDesk.&quot;Category&quot; AS CATEGORY, HPD_HelpDesk.&quot;Requester Name+&quot; AS REQUESTER_NAME, HPD_HelpDesk.&quot;Resolved Time&quot; AS RESOLVED_TIME, HPD_HelpDesk.&quot;Type&quot; AS TYPE
FROM &quot;HPD:HelpDesk&quot; HPD_HelpDesk
WHERE DATETIME(HPD_HelpDesk.&quot;Arrival_Time&quot;,'mm/dd/yy') >= '1/15/01'
AND DATETIME(HPD_HelpDesk.&quot;Arrival_Time&quot;,'mm/dd/yy') <= '7/15/01'
 
The sintax you have sure do not look like T-SQL sintax for MS SQL Server, what SQL implemtation is that?
On SQL server t-SQL I would write like this on query analyzer:

SELECT [Arrival Time] AS ARRIVAL_TIME,
[Assign Time] AS ASSIGN_TIME,
[Case ID] AS CASE_ID,
[Category] AS CATEGORY,
[Requester Name] AS REQUESTER_NAME,
[Resolved Time] AS RESOLVED_TIME,
[Type] AS TYPE
FROM HPD_HelpDesk
WHERE Arrival_Time BETWEEN 'My Start DateTime Here' AND 'My End DateTime Here' AL Almeida
NT/DB Admin
&quot;May all those that come behind us, find us faithfull&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top