Date Time strings in SQL 2000 should be encased in #'

so your end query should essentially look like this:

Select sum(C901001003-C901001002) from T255 Where C3 > #10/7/2007 12:00:00
AM#

Hope This Helps,

Matt



On 10/9/07, Bao, Hui-Qing <[EMAIL PROTECTED]> wrote:
>
> **
>
> Hello All,
>
>
>
> I have a SQL statement in Set Field action, and I have to pass a Date/Time
> variable ($Start Date1$) to the query:
>
>
>
> Select sum(C901001003-C901001002) from T255 Where C3 > $Start Date1$
>
>
>
> I got incorrect syntax error. The sql statement looks like this the
> database log:
>
>
>
> Select sum(C901001003-C901001002) from T255 Where C3 > 10/7/2007 12:00:00
> AM
>
>
>
> I know Remedy store Date/Time as integer in the database (by the way, we
> are using MS SQL 2000), I wonder if there is any function I can use to
> convert Date/Time to Int before I can pass the variable to the query???
>
>
>
> I tried server side table loop to perform the same task, but since the
> table is huge (couple hundreds thousands of records) always get time out, so
> I figure I have to use direct SQL.
>
>
>
> I opened a ticket with BMC last week, they just sent me the pdf of
> DatebaseRefGuide.
>
>
>
> Please help!!
>
>
>
> Hui
>
>
> __20060125_______________________This posting was submitted with HTML in
> it___

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the 
Answers Are"

Reply via email to