Skip to Content.
Sympa Menu

freetds - Re: CONVERT and MSSQL

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: <mitch AT mdmiller.com>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: CONVERT and MSSQL
  • Date: Mon, 11 Mar 2002 10:46:18 -0600 (CST)


Or how about

SELECT *
FROM table
WHERE datecol >= '3/1/2002'
AND datecol < '4/1/2002'

This scenario would allow use of an index, which I think none of the
others would since they're not SARGs.

-- Mitch


On Mon, 11 Mar 2002, Kaeptn Weltall wrote:

> try
>
> select * from table_name
> where datepart(yyyy,column_name) = 2002
> and datepart(mm,column_name) = 3
>
> what will spare you dependence on stringoutput format
> of datetime and good deal of processing time.
>
> ---
> You are currently subscribed to freetds as: [mitch AT mdmiller.com]
> To unsubscribe, forward this message to $subst('Email.Unsub')
>





Archive powered by MHonArc 2.6.24.

Top of Page