View Full Version : Getting values for each day from one column


binnygreen
08-01-2006, 01:01 AM
Hello!

I have problem designing query for table whitch have 4 columns(ID,Date,Name,Value). I have one record each day for station(Name).

Now I would like to get a difference between each day for a month. (See picture)

Thanks in advance!

mhartman
08-01-2006, 01:05 PM
Hello:
What you need to use is the DateDiff Function:
'
DateDiff Function

Returns a Variant (Long) specifying the number of time intervals between two specified dates.

Syntax

DateDiff(interval, date1, date2[, firstdayofweek[, firstweekofyear]])
'
Regards
Mark


The DateDiff function syntax has these named arguments:

pdx_man
08-01-2006, 03:47 PM
Hmmm, if you look at the attachment, that is not what the OP is looking for, but thanks for trying to help. :D

Take a look at the DLOOKUP function. It would be something like
Value - Nz(DLOOKUP("Value", "YourTable", [date] = DateAdd('d',-1,YourTable.[date]) AND Name = YourTable.Name), Value)

You will have to play with this, but it should get you close.