Convert DateTime into MM/DD/YYYY format???


I have this gridview and using this filterexpresson thing.
So I pass the where statement to gridview and I am trying to compare date field.
I am trying to look for past dated items.

Find 60 days past due from today:
Select * from orders where [expiratiodate] < getdate()-60;
This works find in SQL but doesn't work with the C# gridview.
HOw can fix this so it will work?
Gridview.FilterExpresson = "[expirationdate] < GetDate() - 60"
[expirationdate] field is Smalll Date field in sql.
Who is Participating?
CoyotesITConnect With a Mentor Commented:

DateTime.Now.Subtract(new TimeSpan(60,0,0,0));

Will that work?
prairiedogConnect With a Mentor Commented:
What is the current format for expirationdate?
dkim18Author Commented:
I put '' and it worked out ok.
All Courses

From novice to tech pro — start learning today.