Hello,
I have the following DATEADD function I used in a stored procedure:
(downloadedOrders.EditDt > DATEADD(hh, - 1, GETDATE()))
This works great for me but when I try to use it in a linked server I keep getting errors. Here is an example of what I have on my linked server:
select print_ticket_ind, Class_name,Status,acct_id, section_name, event_date, event_time,printed_datetime from openquery(premclub, 'select * from dba.v_ticket where Class_Name = ''PC_Default''and Status = ''Sold'' and print_ticket_ind = ''y''and section_name like ''ST%'' or section_name like ''%view%'' or section_name like ''patron%'' and event_date > ''2011-04-25'' AND printed_datetime > DATEADD('hh, - 1', GETDATE()))''')
Any help would be greatly appreciated!
Thank you,
Brendon
I have the following DATEADD function I used in a stored procedure:
(downloadedOrders.EditDt > DATEADD(hh, - 1, GETDATE()))
This works great for me but when I try to use it in a linked server I keep getting errors. Here is an example of what I have on my linked server:
select print_ticket_ind, Class_name,Status,acct_id, section_name, event_date, event_time,printed_datetime from openquery(premclub, 'select * from dba.v_ticket where Class_Name = ''PC_Default''and Status = ''Sold'' and print_ticket_ind = ''y''and section_name like ''ST%'' or section_name like ''%view%'' or section_name like ''patron%'' and event_date > ''2011-04-25'' AND printed_datetime > DATEADD('hh, - 1', GETDATE()))''')
Any help would be greatly appreciated!
Thank you,
Brendon