Datediff Once again

S

senkurion

Hello,

I have a field "Account opened on" and i would like to calculate the date
difference between "Account opened on" and quarterly date related.
for example if "Account opened on" is May 16, 2007 the I would like to
count the in days difference between May 16 2007 and June 30 2007 (end of
the second quarter)
I tried following expression but it does not work

Datediff("d",[Account opened on],("q2",[Account opened on]

Please help
 
S

senkurion

just to make things clearrer, i havr to use the fiels "Account opened on" and
end date of corresponding quarter I cant use dates themselves.

Thanks once again
 
M

Marshall Barton

senkurion said:
Hello,

I have a field "Account opened on" and i would like to calculate the date
difference between "Account opened on" and quarterly date related.
for example if "Account opened on" is May 16, 2007 the I would like to
count the in days difference between May 16 2007 and June 30 2007 (end of
the second quarter)
I tried following expression but it does not work

Datediff("d",[Account opened on],("q2",[Account opened on]


Datediff("d",[Account opened on],DateSerial(Year([Account
opened on]), 3*((Month([Account opened on])-1)\3)+4, 0)
 
S

senkurion

Thanks Marshal,
Looks like I was not clear enough in my question , my mistake

I have one question on your expression, will that work for any other dates
say like Jun 3, 2007?? or say if i want to calculate the day difference
between feb 5 and first quarter of 2007 or say day difference between October
25 and rest of the quarter.Thanks




Marshall Barton said:
senkurion said:
Hello,

I have a field "Account opened on" and i would like to calculate the date
difference between "Account opened on" and quarterly date related.
for example if "Account opened on" is May 16, 2007 the I would like to
count the in days difference between May 16 2007 and June 30 2007 (end of
the second quarter)
I tried following expression but it does not work

Datediff("d",[Account opened on],("q2",[Account opened on]


Datediff("d",[Account opened on],DateSerial(Year([Account
opened on]), 3*((Month([Account opened on])-1)\3)+4, 0)
 
M

Marshall Barton

What makes you think you were not clear enough?

Did you try the expression I posted? If not, why not? If
you did, what was wrong with the result?
--
Marsh
MVP [MS Access]

Looks like I was not clear enough in my question , my mistake

I have one question on your expression, will that work for any other dates
say like Jun 3, 2007?? or say if i want to calculate the day difference
between feb 5 and first quarter of 2007 or say day difference between October
25 and rest of the quarter.Thanks


Marshall Barton said:
Datediff("d",[Account opened on],DateSerial(Year([Account
opened on]), 3*((Month([Account opened on])-1)\3)+4, 0)
senkurion said:
I have a field "Account opened on" and i would like to calculate the date
difference between "Account opened on" and quarterly date related.
for example if "Account opened on" is May 16, 2007 the I would like to
count the in days difference between May 16 2007 and June 30 2007 (end of
the second quarter)
I tried following expression but it does not work

Datediff("d",[Account opened on],("q2",[Account opened on]
 
S

senkurion

Sorry,

Text alignment was right hand side so could not see the result of the
expression. It worked perfectly well. Thank you very much.

Marshall Barton said:
What makes you think you were not clear enough?

Did you try the expression I posted? If not, why not? If
you did, what was wrong with the result?
--
Marsh
MVP [MS Access]

Looks like I was not clear enough in my question , my mistake

I have one question on your expression, will that work for any other dates
say like Jun 3, 2007?? or say if i want to calculate the day difference
between feb 5 and first quarter of 2007 or say day difference between October
25 and rest of the quarter.Thanks


Marshall Barton said:
Datediff("d",[Account opened on],DateSerial(Year([Account
opened on]), 3*((Month([Account opened on])-1)\3)+4, 0)
senkurion wrote:
I have a field "Account opened on" and i would like to calculate the date
difference between "Account opened on" and quarterly date related.
for example if "Account opened on" is May 16, 2007 the I would like to
count the in days difference between May 16 2007 and June 30 2007 (end of
the second quarter)
I tried following expression but it does not work

Datediff("d",[Account opened on],("q2",[Account opened on]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top