Re: date time comparrisons...

Re: date time comparrisons...

 

  

DATEDIFF function is very good at that.
DATEDIFF(datepart, startdate, enddate)


Daniel



Craig Rosenblum wrote:

> I want to compare a datetime field against getdate
>
> but like show data within the last 30 minutes.
>
> does this require a lengthy convert statement?
>
> P.S. Does anyone have any favorite daily checklists of things you do to
> make sure the databases are optimal?
>
> P.S.S. One of my new pet projects is finding sql server scripts that
> bring necessary data about performance, scheduled task failures, and sql
> server version, using coldfusion to grab and stuff it into a text file
> every 30 minutes. Then using a tool called coolmon to display it on my
> desktop, so I can easily get the latest sql server data without opening
> another program. BTW http://coolmon.arsware.org
>
> What kind of sql server data would you want to have on your desktop to
> help keep an eye on success/failure of sql server?
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To unsubscribe, e-mail: mssqldba-[Email Address Removed] For additional commands, e-mail: mssqldba-[Email Address Removed]MS Sql Server LazyDBA home page