Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: how to compare a year with a date`


Message #1 by Pritesh Mehta <Pritesh.Mehta@h...> on Tue, 19 Sep 2000 22:19:40 +0100
greetings, 



how would I go about comparing a date in a database (02/16/00 format) to a

year value? (01 format)



i would like to test this in the SQL string if possible



maybe something like:



<%

sqlstr = "SELECT * FROM t_calendar where getYear(startdate) = " & varYear &

" ORDER BY startdate;"

%>



???







if you have any ideas please let me know!



TIA



p























mailto:pritesh.mehta@h...



Message #2 by "Nick" <nickm@t...> on Wed, 20 Sep 2000 10:20:03 +0000
You can use the YEAR(date) command in SQL Server 7 which returns the 4 digit

year of the date passed.



----------

>From: Pritesh Mehta <Pritesh.Mehta@h...>

>To: "ASP Databases" <asp_databases@p...>

>Subject: [asp_databases] how to compare a year with a date`

>Date: Tue, Sep 19, 2000, 21:19

>



> greetings,

>

> how would I go about comparing a date in a database (02/16/00 format) to a

> year value? (01 format)

>

> i would like to test this in the SQL string if possible

>

> maybe something like:

>

> <%

> sqlstr = "SELECT * FROM t_calendar where getYear(startdate) = " & varYear &

> " ORDER BY startdate;"

> %>

>

> ???

>

>

>

> if you have any ideas please let me know!

>

> TIA

>

> p

>

>

>

>

>

>

>

>

>

>

>

> mailto:pritesh.mehta@h...

>

>




  Return to Index