How to spell out a C# SQL Query with Date Values In It

Given the following query, (which successfully returns many values)....

SQLQuery.CommandText = "Select ID, CME_Program, Date_From, Date_To, Activity_Type, Activity_Place, Activity_Sponsor, Test_Taken, Certifying_Institution, CME_Credits, 'Delete' as ActionLink, 'Click' as Button from CMERecords2 order by Date_From ASC";

How do I rewrite the same query so that it has a WHERE clause that selects only those
entries where the value called "Date_From" is from the year 2008.

?
Leonard GojerCAD Technician/ProgrammerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
LIONKINGConnect With a Mentor Commented:
Assuming you have SQL Database, you could use:

SQLQuery.CommandText = "Select ID, CME_Program, Date_From, Date_To, Activity_Type, Activity_Place, Activity_Sponsor, Test_Taken, Certifying_Institution, CME_Credits, 'Delete' as ActionLink, 'Click' as Button from CMERecords2 WHERE YEAR(Date_From)=2008  order by Date_From ASC";
0
All Courses

From novice to tech pro — start learning today.