1
Answer

date comparision

Photo of sameer gadade

sameer gadade

12y
871
1
hi i have 2 text boxes start date and end date. i want to fetch records between dates. but the problem is my data base stores the dates in varchar format hence i am unable to match the condition

please help me i am new to sql server

textboxes gets values in date format from calender control

please reply the query??????

Q)table structure

stud_id,name,start _date(varchar),end_Date(varchar)

Answers (1)

0
Photo of Muralidharan Deenathayalan
NA 11.9k 1.5m 12y
Please use the same data type and format in both the application as well in the datbase. Use convert function in sql server and from c# side, Convert.ToString(datetime,formatstring); Hope this might help you.