Noor,

I think using CAST to convert to datetime should solve the problem.

SELECT user_info.*
FROM user_info
WHERE user_info.getlogin_ready NOT IN ('0','1')
AND DATEDIFF(hour,CAST(user_info.getlogin_ready AS DATETIME),getdate()) < 24

Colin

> -----Original Message-----
> From: Noor Farizan Morshidi (AMS E-Business)
> [mailto:[EMAIL PROTECTED]]
> Sent: 30 May 2001 02:11
> To: SQL
> Subject: RE: SQL PROBLEM -Reply
>
>
> Dear Colin,
>
> I have try it, and it's work for datetime datatype.  But i
> have a little bit
> problem. Actually getlogin_ready is nvarchar datatype and the
> value is 0,
> 1 or date. when i run this sql, error [microsoft] [ODBC SQL SERVER
> DRIVER][sql server]Arithmetic overflow error converting
> expression to data type datetime. What should i do?? Do i have to
> convert the getlogin_ready to smalldatetime datatype. How should i do
> it??
>
> regards
> noor
>
>
> >>> "Colin Robinson" <[EMAIL PROTECTED]>
> 05/29/01 04:41pm
> >>>
> Noor,
>
> Try this:
>
> SELECT user_info.*
> FROM user_info
> WHERE user_info.getlogin_ready NOT IN ('0','1')
> AND DATEDIFF(hour,user_info.getlogin_ready,getdate()) < 24
>
> Colin
>
>
> > -----Original Message-----
> > From: Noor Farizan Morshidi (AMS E-Business)
> > [mailto:[EMAIL PROTECTED]]
> > Sent: 29 May 2001 01:58
> > To: SQL
> > Subject: SQL PROBLEM
> >
> >
> > here is my coding. Actually i want to write a coding
> > including the [<cfset
> > Howmanyhour = Abs(DateDiff("H",now(),getlogin_ready))>
> > <cfif Howmanyhour LT "24">] in my sql so that i can output
> > the records in
> > the cfmail without the cfset and cfif statement. Can anyone
> > please help
> > me. I really needed it..
> >
> > regards
> >
> > my coding
> > -------------
> >
> > <cfquery name="GetRecordCollected" datasource="clientmaster"
> > dbtype="ODBC">
> >     Select *
> >     from user_info
> >     where getlogin_ready <> '1' OR getlogin_ready <> '0'
> > </cfquery>
> >
> > <cfmail to="[EMAIL PROTECTED]" from="[EMAIL PROTECTED]"
> > subject="Collection New web userid and Password">
> >
> > Collected
> > --------------------------------------------------------------
> > --------------------------
> > <cfloop query="GetRecordCollected">
> > <cfset Howmanyhour = Abs(DateDiff("H",now(),getlogin_ready))>
> > <cfif Howmanyhour LT "24">
> > MY OUTPUT
> > </cfif>
> > </cfloop>
> > </cfmail>
> >
> >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to