robertokalos
New Member
- Joined
- Nov 29, 2011
- Messages
- 5
Hello,
I have a macro that doesnt work. The problem is at the 2nd date restriction that I have ((""CR-Ticket"".""Request Date""<={ ts '" & Format(Range("A1").Value, "yyyy-mm-dd 00:00:00") & "'})
Do you know, what I am doing wrong?
I have a macro that doesnt work. The problem is at the 2nd date restriction that I have ((""CR-Ticket"".""Request Date""<={ ts '" & Format(Range("A1").Value, "yyyy-mm-dd 00:00:00") & "'})
Do you know, what I am doing wrong?
Code:
[SIZE=3][FONT=Times New Roman]With Selection.QueryTable<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] .Connection = _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] "ODBC;DRIVER={AR System ODBC Driver};ARServer=HAYDN;UID=kyster;PWD=password;ARAuthentication=;SERVER=NotTheServer"<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] .CommandText = Array( _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] "SELECT ""CR-Ticket"".Application, ""CR-Ticket"".""Business Priority"", ""CR-Ticket"".Item, ""CR-Ticket"".""Request Date"", ""CR-Ticket"".Department, ""CR-Ticket"".""Requested by"", ""CR-Ticket"".""Service Type"", ""CR-Ticke" _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] , _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] "t"".""CR ID"", ""CR-Ticket"".Status, ""CR-Ticket"".""Assigned To"", ""CR-Ticket"".""Closed Date"", ""CR-Ticket"".Priority, ""CR-Ticket"".Phase, ""CR-Ticket"".""Target Release"", ""CR-Ticket"".Module, ""CR-Ticket"".Entity" & Chr(13) & "" & Chr(10) & "FRO" _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] , _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] "M ""CR-Ticket"" ""CR-Ticket""" & Chr(13) & "" & Chr(10) & "WHERE (""CR-Ticket"".Application='CLM') AND (""CR-Ticket"".Status<>'Rejected' And ""CR-Ticket"".Status<>'Closed') AND (""CR-Ticket"".Entity='Finance+Risk') AND (""CR-Ticket"".""Request" _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] , _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] " Date""<={ts '" & Format(Range("A1").Value, "yyyy-mm-dd 00:00:00") & "'}) OR (""CR-Ticket"".Status<>'Rejected' And ""CR-Ticket"".Status<>'Closed') AND (""CR-Ticket"".Entity='FKL Project') AND (""CR-Ticket"".""Request Date""<={ ts '" & Format(Range("A1").Value, "yyyy-mm-dd 00:00:00") & "'})" & Chr(13) & "" & Chr(10) & "ORDER BY ""CR-Ticket"".""Service Type"" DESC, ""CR-Ticket"".Status, ""CR-Ticket"".""Assigned To"", ""CR-Ticket"".""CR ID""" _<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] )<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] .Refresh BackgroundQuery:=False<o:p></o:p>[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]End With[/SIZE][/FONT]