Hello,
I have a table with a Day field, defined as smalldatetime. I am filling it
from a CSharp application with the following code:
DataRow r = dtStaDays.NewRo w();
r["Station_ID "]= station_ID;
r["Day"] = sd.Date;
r["Range"] = rangeTide;
etc.
However when I do a query using
"Select * FROM StationDays where Station_ID = 8 and Day = 06/01/2005"
I don't get any results even though that row exists. To make it work I have
to use
"Select * FROM StationDays where Station_ID = 8 and Day > 06/01/2005"
(which isn't very satisfactory
or
SELECT * FROM StationDays WHERE (Station_ID = 8) AND ([Day]
= CONVERT(DATETIM E, '2005-01-06 00:00:00', 102))
What can I do to simplify this query?
Thanks
Marc Pelletier
I have a table with a Day field, defined as smalldatetime. I am filling it
from a CSharp application with the following code:
DataRow r = dtStaDays.NewRo w();
r["Station_ID "]= station_ID;
r["Day"] = sd.Date;
r["Range"] = rangeTide;
etc.
However when I do a query using
"Select * FROM StationDays where Station_ID = 8 and Day = 06/01/2005"
I don't get any results even though that row exists. To make it work I have
to use
"Select * FROM StationDays where Station_ID = 8 and Day > 06/01/2005"
(which isn't very satisfactory
or
SELECT * FROM StationDays WHERE (Station_ID = 8) AND ([Day]
= CONVERT(DATETIM E, '2005-01-06 00:00:00', 102))
What can I do to simplify this query?
Thanks
Marc Pelletier
Comment