date query

Results 1 to 2 of 2

Thread: date query

  1. #1
    Join Date
    Dec 1969

    Default date query

    i am accepting two fields in a form agefrom and ageto (e.g 20 and 25). I have a table with date of birth (date/time type) . How do i retrieve records with age between 20 and 25 or do i have make some changes in database by adding a age column ?<BR><BR>brij <BR>

  2. #2
    Join Date
    Dec 1969

    Default need not

    use powerful sql queries to retreive the records that have a date difference of 20 to 25<BR><BR>select * from table where datediff(yy,dobfield,getdate()) between 20 and 25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts