DateAdd and a query

  • Thread starter Thread starter Tree
  • Start date Start date
T

Tree

Guest
hello,

im having aproblems with the dateAdd function. i dont know if what im doing is even possible.


I want to calculate a value to add onto a date in a query. For example:

ValuetoAdd: [x]*[y]


I then want to use dateAdd in another field in the query:


Between Date() And DateAdd("d",+30,Date())

EXCEPT, i want the +30 to be whatever number ValuetoAdd is. I cant add a constant number because the number is worked out by timesing x and y together, and they are always different.


How do i make DateAdd use a value worked out in the query?

Between Date() And DateAdd("d",+ValuetoAdd,Date())

and

Between Date() And DateAdd("d",+[ValuetoAdd],Date())


do not work.


Thanks in advance.
 
If "x" and "y" are fields in the table then try:

Between Date() And DateAdd("d",[x]*[y],Date())

HTH
RDH
 

Users who are viewing this thread

Back
Top Bottom