bradderick
asked on
Adding days to a date then sorting by the new date
Hi All,
I'm having some trouble figuring out how to sort by a date which is not stored in the database but which is calculated on-the-fly on my webpage by adding a number of days to another date.
So we have the following fields in the table UserDetails:
Date (smalldatetime ('dd/mmyyyy')
Term (int)
I am trying to sort my results by DueDate (which is dynamically calculated and not stored as a field in the db) which is Date ('dd/mm/yyyy') + Term (number of days (int) ).
So I am wondering if there is anyway that inside my SELECT in my SQL statement I can actually create a new date AS DueDate which is the above sum?
Anyone have any ideas?
Cheers,
Brad
I'm having some trouble figuring out how to sort by a date which is not stored in the database but which is calculated on-the-fly on my webpage by adding a number of days to another date.
So we have the following fields in the table UserDetails:
Date (smalldatetime ('dd/mmyyyy')
Term (int)
I am trying to sort my results by DueDate (which is dynamically calculated and not stored as a field in the db) which is Date ('dd/mm/yyyy') + Term (number of days (int) ).
So I am wondering if there is anyway that inside my SELECT in my SQL statement I can actually create a new date AS DueDate which is the above sum?
Anyone have any ideas?
Cheers,
Brad
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Your welcome, glad it worked for you and thanks for the grade
Cheers
Scott
Cheers
Scott
ASKER
It seems so simple :o) I really appreciate your help.
Cheers,
Brad