I have a select statement as stated below:
string stmt = "select DISTINCT SubjectSchedule.SubjectID,
Subject.SubjectName, (Convert (char(12),
SubjectSchedule.SubjectStartDate,106)) as SubjectStartDate, (Convert
(char(12), SubjectSchedule.SubjectEndDate,106))as SubjectEndDate from
SubjectSchedule INNER JOIN Subject ON SubjectSchedule.SubjectID =
Subject.SubjectID where SubjectSchedule.CourseID='" + CrseID + "'AND
(Convert (char(12),SubjectSchedule.CourseStartDate,106)) as
SubjectSchedule.CourseStartDate='" + CourseStart + "'AND
SubjectSchedule.TutorID='" + id + "'";
When I run, it give me an error as stated below:it seem that the
SubjectSchedule.CourseStartDate has problem in the conversion - Where
did I go wrong? Please help. I am very new with asp.net.
Server Error in '/WebSite3' Application.
----------------------------------------------------------------------
Error in Select Command{ select DISTINCT SubjectSchedule.SubjectID,
Subject.SubjectName, (Convert (char(12),
SubjectSchedule.SubjectStartDate,106)) as SubjectStartDate, (Convert
(char(12), SubjectSchedule.SubjectEndDate,106))as SubjectEndDate from
SubjectSchedule INNER JOIN Subject ON SubjectSchedule.SubjectID =
Subject.SubjectID where SubjectSchedule.CourseID='BIT'AND
SubjectSchedule.CourseStartDate='01'AND
SubjectSchedule.TutorID='A' }: Syntax error converting datetime from
character string.
------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/