| Author |
Topic |
|
JezLisle
Posting Yak Master
132 Posts |
Posted - 2008-09-08 : 09:48:42
|
| In Excel I use the RounDown function, I'm relatively new to SQL Server.How would it be possible to workout the difference in dates between todays date and a date input into a database. The function I use in Excel is =ROUNDDOWN((today()-B1)/7,0) |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
|
JezLisle
Posting Yak Master
132 Posts |
Posted - 2008-09-08 : 10:01:24
|
| I'm looking at the difference in days between to dates. Date1 is today and Date2 is a date entered by user. |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
|
JezLisle
Posting Yak Master
132 Posts |
Posted - 2008-09-09 : 04:50:48
|
| I've had a read of your link you attached Jeff, Thanks...I'm a little unsure on things still. Using the CAST()Function, I trying to workout the difference between the 2 days. I looked at the samething in Access and found that CInt(Date()-[Date on Waiting List])/7 AS [Weeks Waiting] worked how I wanted. How can I transfer this to SQL Server? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-09-09 : 05:00:50
|
| UseDATEDIFF(DAY,[Date on Waiting List]),GETDATE())/7MadhivananFailing to plan is Planning to fail |
 |
|
|
JezLisle
Posting Yak Master
132 Posts |
Posted - 2008-09-09 : 05:17:58
|
| Thanks, It tells me that using DATEDIFF(DAY,[Date on Waiting List]),GETDATE())/7 That datediff function requires 3 argument(s) |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-09-09 : 05:26:40
|
| That should beDATEDIFF(DAY,[Date on Waiting List],GETDATE())/7MadhivananFailing to plan is Planning to fail |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-09-09 : 05:27:09
|
Remove the extra paranthesisDATEDIFF ( DAY , [Date on Waiting List] , GETDATE() ) / 7 E 12°55'05.63"N 56°04'39.26" |
 |
|
|
JezLisle
Posting Yak Master
132 Posts |
Posted - 2008-09-09 : 05:32:18
|
| Excellent Thanks :) |
 |
|
|
|