Wednesday, March 21, 2012

Problem function year in sql mobile

Dear , all

I have a problem in fucntion year in sql mobile , Use select Date_in from Test Where Year(Date_in) = 8

Brg

Tingnong

The YEAR function does not exist in SQL Compact, you can use:

Code Snippet

DATEPART(yy, date)

like so:

Code Snippet

select [Order Date] from Orders Where DATEPART(yy, [Order date]) = 1991

(Using Northwind.sdf inculded with SQL Compact 3.1 SDK)

No comments:

Post a Comment