Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Garbage after statement while using WHERE [Last Modified Date] >=$(vLastExecTime) and [Last Modified Date] < $(vExecTime)

Hi All,

I'm Getting an error "Garbage after statement" while using WHERE [Last Modified Date] >=$(vLastExecTime) and [Last Modified Date] < $(vExecTime).

when i remove " WHERE [Last Modified Date] >=$(vLastExecTime) and [Last Modified Date] < $(vExecTime).0" from my script its working fine.

Please help me if any one can.

Thanks in Advance...

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try putting single quotes around variables like:

WHERE [Last Modified Date] >= '$(vLastExecTime)' and [Last Modified Date] < '$(vExecTime)' ;


If the date formats match, this should work.

View solution in original post

5 Replies
tresesco
MVP
MVP

Try putting single quotes around variables like:

WHERE [Last Modified Date] >= '$(vLastExecTime)' and [Last Modified Date] < '$(vExecTime)' ;


If the date formats match, this should work.

hic
Former Employee
Former Employee

Probably because your variables are texts - a time stamp and a date. If so, you can either write your where clause with single quotes:

WHERE [Last Modified Date] >='$(vLastExecTime)' and [Last Modified Date] < '$(vExecTime)'


or you can define the variables numerically:

Let vLastExecTime = Num(...)

and write the where clause with numeric expansions:

WHERE [Last Modified Date] >=$(#vLastExecTime) and [Last Modified Date] < $(#vExecTime)


HIC


rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Your variables vLastExecTime and vExecTime may not be initialized correctly. Look in the Document Log to see what values are being substituted in the WHERE clause.

-Rob

http://robwunderlich.com

Not applicable
Author

Thanks...

It is working fine..

Thanks lot.

Not applicable
Author

Thanks...

Both Solutions are working fine

Thanks lot