Jeremy
7/20/2007 5:32:00 PM
SELECT
DATEPART(year, [DateOpen]) AS YearPart ,
DATEPART(week, [DateOpen]) AS WeekNum
FROM ...
"JP Bless" wrote:
> I have a DateTime Field that stores Date as "07/20/2007 10:20:0 AM" in
> Access MDB. I am trying to upsize the mdb file to SQL 2005 express. The SQL
> below works OK in Access to retrieve the record's year and week. In SQL 2005
> express I get the error "format is not a built in function"
>
> ssql = "SELECT Format([DateOpen],'yyyy') AS YearPart,
> Format([DateOpen],'ww') AS WeekNum"
>
> My question... How should I change the above SQL to retrive both year and
> week on a given longdatetime field in SQL Express 2005. I am using ADO
> connection VB6SP5. I have googled but haven't found a clue. Thanks in
> advance
>
>
>