J Jose Luis Balsera Jul 24, 2004 #1 I don't think you should format dates as string to pass them as parameters to the command object. Simply pass them as DateTime objects
I don't think you should format dates as string to pass them as parameters to the command object. Simply pass them as DateTime objects
G Guest Jul 25, 2004 #2 ok..i've remove the format dates..but it's still not working..am i putting the correct parameter especially on this statement?thanks AND order_date BETWEEN @order_date AND @order_date <----
ok..i've remove the format dates..but it's still not working..am i putting the correct parameter especially on this statement?thanks AND order_date BETWEEN @order_date AND @order_date <----
J Jon Skeet [C# MVP] Jul 25, 2004 #3 chris said: ok..i've remove the format dates..but it's still not working..am i putting the correct parameter especially on this statement?thanks AND order_date BETWEEN @order_date AND @order_date <---- Click to expand... You're specifying the same parameter twice - you need to use AND order_date BETWEEN @lower_order_date AND @upper_order_date .... cm.Parameters.Add("@lower_order_date", startDate) cm.Parameters.Add("@lower_order_date", endDate)
chris said: ok..i've remove the format dates..but it's still not working..am i putting the correct parameter especially on this statement?thanks AND order_date BETWEEN @order_date AND @order_date <---- Click to expand... You're specifying the same parameter twice - you need to use AND order_date BETWEEN @lower_order_date AND @upper_order_date .... cm.Parameters.Add("@lower_order_date", startDate) cm.Parameters.Add("@lower_order_date", endDate)
A Alex Feinman [MVP] Jul 25, 2004 #4 And now you are specifying the parameter twice said: cm.Parameters.Add("@lower_order_date", startDate) cm.Parameters.Add("@lower_order_date", endDate) Click to expand... cm.Parameters.Add("@lower_order_date", startDate) cm.Parameters.Add("@upper_order_date", endDate)
And now you are specifying the parameter twice said: cm.Parameters.Add("@lower_order_date", startDate) cm.Parameters.Add("@lower_order_date", endDate) Click to expand... cm.Parameters.Add("@lower_order_date", startDate) cm.Parameters.Add("@upper_order_date", endDate)
J Jon Skeet [C# MVP] Jul 25, 2004 #5 Alex Feinman said: cm.Parameters.Add("@lower_order_date", startDate) cm.Parameters.Add("@upper_order_date", endDate) Click to expand... Apologies - that's what I get for posting at 3 in the morning
Alex Feinman said: cm.Parameters.Add("@lower_order_date", startDate) cm.Parameters.Add("@upper_order_date", endDate) Click to expand... Apologies - that's what I get for posting at 3 in the morning