Hi everybody,
I am having problem with this query
I am using Access database and asp.net c# 2.0 to reterieve things using this
query
select count(*) as itemTotal from schoolitemmap
where (schoolid =1 and OrderDate = 8/3/2009) and itemId = 1
this query does not return nything.
(this date used in query is in m/d/y format as a
string)
and m using date() function as default value for OrderDate field in database
which is also in format (m/d/y)
Plase help .......
Thanks
Loading

Roei BarRank #1,271 · 1.4K reputationPosted Aug 22, 2009, 12:57 AM EDT
here is the working code
if you liked this dont forget to mark "Accepted Answer"
kawaljit singh16 reputationPosted Aug 22, 2009, 1:05 AM EDT
but i hav to pass the value to orderdate through a textbox using ajax calender extender...............in which date is selected in mm/dd/yy format......
how do i convert this textbox value (date) to date format of access............
Roei BarRank #1,271 · 1.4K reputationPosted Aug 22, 2009, 4:05 AM EDT
just do the following
string selectedDate = Calander.SelectedValue;
selectedDate = selectedDate.Replace("/", "-");
and then :
selectedDate = "#" + selectedDate + "#" select count(*) as itemTotal from schoolitemmap where (schoolid =1 and OrderDate = OrderDateParam) and itemId = 1dont forget to mark this as "Accepted Answer"