|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Quick query Question
I have a quick question involving a query I need to run.
I have a field on a form that I can only use a calculated SQL command to fill. The field is going to be a calculated date field. It is based on a selected urgency (which equates to time), and an open date. What I need this new field to be is the sum of these 2 fields, but if it is after 5:00, then it should take the difference between the time it would end at and 5:00, and then add it to 8:00 the next day. so if the open date is 6/24/04 16:30:00 and the urgency would call for 04:00:00 hours then this new field should come out to 6/25/04 11:30:00 if it is 06/24/04 12:00:00 and 04:00:00 hours then it would show 06/24/04 16:00:00. (this part is easy, but the top part is confusing) Any help is appreciated |
|
#2
|
|||
|
|||
|
I would think you would handle something like that in your application's code, vbscript/asp whatever your writing it in.
|
|
#3
|
||||
|
||||
|
you can easily do this with CASE expressions in the sql
by any chance, are you going to want to skip from fridays at 17:00 to mondays at 8:00? because that makes the expressions a lot more complex |
|
#4
|
|||
|
|||
|
Use the DATEPART() function to get different parts of your date and as r937 said you can then use CASE Expressions to determine what to do with your date
|
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Quick query Question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|