search by date

  • Thread starter Thread starter John
  • Start date Start date
J

John

If I want to add code to allow the user to select an item that was added to
the database in the last x number of days, I assume I need to add a
dateadded field to the database, or is it already there somewhere?
 
Hi,

You need to add a DateTime field and query the table returning rows having DateAdded > Last X Days.
 
Hi John,

I agree with Morten that you need to add a field of DateTime in the table.

When you add a new row into the table, you should assign the current time
to this field.

If you are using VS 2005, you may use a TableAdapter to query the table
with a datetime parameter. If you are using VS 2003, you may use a
SqlDataAdapter to do the query.

Hope this helps.
If you have any questions, please feel free to let me know.


Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top