Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
zerohour80
Starting Member
5 Posts |
Posted - 2004-06-28 : 13:48:26
|
| Having a problem using the datediff function in access. Below is my first select statement which puts the time and date together. SELECT BatchCards.Formulation, [Formulation] & "-" & [Batch] AS Product, [Date] & " " & [Time] AS Date_Time, BatchCards.AdjustmentFROM BatchCards;Then my next select statement uses the info from above to calulate the datediff in hours. SELECT visq.Product, visq.Formulation, Sum(visq.Adjustment) AS SumOfAdjustment, DateDiff('h',Min([date_time]),Max([date_time])) AS datediffhFROM visqGROUP BY visq.Product, visq.Formulation; What happens is I get a negative number on some of the datediff field. I think the problem is because I am putting together the time and date field. I think it's converting it to string and that's why I can't do a date diff on that new alais field. Can anyone help? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|