sql statement :: datetime filtering
Posted on 2008-11-16
:: The problem
datetime filter is returning for example only 3 records that are dated today or earlier -- yet I know there are 6 applicable records.
I suspect -- the 1st records may have been recorded in the database in the us-format month, day, year etc.. and all the records are being recorded uk format, day, month, year -- yet, browsing through the actual db records, all datetime's look the same structure visually -- but that might just be the visual studio displaying in a consistent format automatically in that view type.
I have a datagrid that filters just fine -- and I am seeing all 6 records as expected.
The sql statement using the Label_Date.Text = DateTime.Now.ToString("ddd, MMM dd, yyyy"); to compare with as follows:
AND (DateTimeCallBack <= @SystemDate+1)
NOW, I have another sql statement as follows -- which is only returning the 3 records ::
AND DateTimeCallBack < GETDATE()
this db call is actioned from a WinForm (whereas the the example is called via an aspx page).
what am I missing please? is this month/day the issue to hand?