query that runs two variables

  • Thread starter Thread starter Bruce
  • Start date Start date
B

Bruce

I am trying to create a query that will give me the
difference between two dates in a number of days elapsed
format. That portaion works fine, but I also want the
same query to give me the elapsed days if the second date
is missing, subsituting the current date.

Something like:

IF Date2 is Null
Then DateNow()

any suggestions?
 
Thanks Duane. Un fortunately when I pasted your
suggestion into the query and modified the column headers
to match the table it gave me an error message that I was
missing a ! or .(dot) or illegal use of a parenthesis
message.
-----Original Message-----
Try:
NumDays: DateDiff("d",[FirstDate], Nz([SecondDate],Date ()))

--
Duane Hookom
MS Access MVP


I am trying to create a query that will give me the
difference between two dates in a number of days elapsed
format. That portaion works fine, but I also want the
same query to give me the elapsed days if the second date
is missing, subsituting the current date.

Something like:

IF Date2 is Null
Then DateNow()

any suggestions?


.
 
Since this is a query news group, if you have problems with the SQL, please
post it in a reply. None of us can see your work.

--
Duane Hookom
MS Access MVP


Thanks Duane. Un fortunately when I pasted your
suggestion into the query and modified the column headers
to match the table it gave me an error message that I was
missing a ! or .(dot) or illegal use of a parenthesis
message.
-----Original Message-----
Try:
NumDays: DateDiff("d",[FirstDate], Nz([SecondDate],Date ()))

--
Duane Hookom
MS Access MVP


I am trying to create a query that will give me the
difference between two dates in a number of days elapsed
format. That portaion works fine, but I also want the
same query to give me the elapsed days if the second date
is missing, subsituting the current date.

Something like:

IF Date2 is Null
Then DateNow()

any suggestions?


.
 
Certainly Duane. Here is the query statement I used based
on your suggestion:

NumDays: DateDiff("d",[ApplicationDate], Nz
([ActionDate],Date()))

I placed this statement in the "Criteria" section of the
column query. What I am trying to accomplish is a way to
measure the age of a loan application.

ApplicationDate is the day the application was received by
the bank, the ActionDate is the date the Loan was funded
or denied. This tells me how long it took for the loan to
be processed to completion.

The Query I use can also give me the loan age to current
date if there is no action date and that is waht I've ben
trying to accomplish. I hope this helps you help me.


-----Original Message-----
Since this is a query news group, if you have problems with the SQL, please
post it in a reply. None of us can see your work.

--
Duane Hookom
MS Access MVP


Thanks Duane. Un fortunately when I pasted your
suggestion into the query and modified the column headers
to match the table it gave me an error message that I was
missing a ! or .(dot) or illegal use of a parenthesis
message.
-----Original Message-----
Try:
NumDays: DateDiff("d",[FirstDate], Nz([SecondDate],Date ()))

--
Duane Hookom
MS Access MVP


I am trying to create a query that will give me the
difference between two dates in a number of days elapsed
format. That portaion works fine, but I also want the
same query to give me the elapsed days if the second date
is missing, subsituting the current date.

Something like:

IF Date2 is Null
Then DateNow()

any suggestions?


.


.
 
What I gave you should have been used as a calculated column, not as a
criteria.

--
Duane Hookom
MS Access MVP


Bruce said:
Certainly Duane. Here is the query statement I used based
on your suggestion:

NumDays: DateDiff("d",[ApplicationDate], Nz
([ActionDate],Date()))

I placed this statement in the "Criteria" section of the
column query. What I am trying to accomplish is a way to
measure the age of a loan application.

ApplicationDate is the day the application was received by
the bank, the ActionDate is the date the Loan was funded
or denied. This tells me how long it took for the loan to
be processed to completion.

The Query I use can also give me the loan age to current
date if there is no action date and that is waht I've ben
trying to accomplish. I hope this helps you help me.


-----Original Message-----
Since this is a query news group, if you have problems with the SQL, please
post it in a reply. None of us can see your work.

--
Duane Hookom
MS Access MVP


Thanks Duane. Un fortunately when I pasted your
suggestion into the query and modified the column headers
to match the table it gave me an error message that I was
missing a ! or .(dot) or illegal use of a parenthesis
message.
-----Original Message-----
Try:
NumDays: DateDiff("d",[FirstDate], Nz([SecondDate],Date
()))

--
Duane Hookom
MS Access MVP


message
I am trying to create a query that will give me the
difference between two dates in a number of days elapsed
format. That portaion works fine, but I also want the
same query to give me the elapsed days if the second
date
is missing, subsituting the current date.

Something like:

IF Date2 is Null
Then DateNow()

any suggestions?


.


.
 
I got it Duane, thanks for the hep, it worked out great
-----Original Message-----
What I gave you should have been used as a calculated column, not as a
criteria.

--
Duane Hookom
MS Access MVP


Certainly Duane. Here is the query statement I used based
on your suggestion:

NumDays: DateDiff("d",[ApplicationDate], Nz
([ActionDate],Date()))

I placed this statement in the "Criteria" section of the
column query. What I am trying to accomplish is a way to
measure the age of a loan application.

ApplicationDate is the day the application was received by
the bank, the ActionDate is the date the Loan was funded
or denied. This tells me how long it took for the loan to
be processed to completion.

The Query I use can also give me the loan age to current
date if there is no action date and that is waht I've ben
trying to accomplish. I hope this helps you help me.


-----Original Message-----
Since this is a query news group, if you have problems with the SQL, please
post it in a reply. None of us can see your work.

--
Duane Hookom
MS Access MVP


Thanks Duane. Un fortunately when I pasted your
suggestion into the query and modified the column headers
to match the table it gave me an error message that I was
missing a ! or .(dot) or illegal use of a parenthesis
message.
-----Original Message-----
Try:
NumDays: DateDiff("d",[FirstDate], Nz ([SecondDate],Date
()))

--
Duane Hookom
MS Access MVP


message
I am trying to create a query that will give me the
difference between two dates in a number of days elapsed
format. That portaion works fine, but I also want the
same query to give me the elapsed days if the second
date
is missing, subsituting the current date.

Something like:

IF Date2 is Null
Then DateNow()

any suggestions?


.



.


.
 
Back
Top