Calculating new scheduled date in access 97 query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
Please if any one can help me, I need to calculate the Next_Scheduled_Date
according to the Frequency(that depend on the months-1 month, 2 months, 3
months...) and the Scheduled_Date(that its date for exm-1/2/2007). I need
that in the Next_Scheduled_Date will be the sum of Scheduled_Date and the
Frequency(the months). I'm tring to do it in DateSerial formula, but it
giving me Errors.

Thank's
Anna
 
Use DateAdd to add the number of months in the Frequency field to the date
in the Scheduled_Date field:
DateAdd("m", [Frequency], [Scheduled_Date])
 
Thanks, but it's asking me to "Enter parameter value of Scheduled_Date" and
not calculating automaticly?

Allen Browne said:
Use DateAdd to add the number of months in the Frequency field to the date
in the Scheduled_Date field:
DateAdd("m", [Frequency], [Scheduled_Date])

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Anna said:
Hi,
Please if any one can help me, I need to calculate the Next_Scheduled_Date
according to the Frequency(that depend on the months-1 month, 2 months, 3
months...) and the Scheduled_Date(that its date for exm-1/2/2007). I need
that in the Next_Scheduled_Date will be the sum of Scheduled_Date and the
Frequency(the months). I'm tring to do it in DateSerial formula, but it
giving me Errors.

Thank's
Anna
 
Anna, do you have a field named Scheduled_Date?

Use the name of the field you want to add x months to.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Anna said:
Thanks, but it's asking me to "Enter parameter value of Scheduled_Date"
and
not calculating automaticly?

Allen Browne said:
Use DateAdd to add the number of months in the Frequency field to the
date
in the Scheduled_Date field:
DateAdd("m", [Frequency], [Scheduled_Date])

Anna said:
Hi,
Please if any one can help me, I need to calculate the
Next_Scheduled_Date
according to the Frequency(that depend on the months-1 month, 2 months,
3
months...) and the Scheduled_Date(that its date for exm-1/2/2007). I
need
that in the Next_Scheduled_Date will be the sum of Scheduled_Date and
the
Frequency(the months). I'm tring to do it in DateSerial formula, but it
giving me Errors.
 
I found the mistake, Thanks alot

Allen Browne said:
Anna, do you have a field named Scheduled_Date?

Use the name of the field you want to add x months to.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Anna said:
Thanks, but it's asking me to "Enter parameter value of Scheduled_Date"
and
not calculating automaticly?

Allen Browne said:
Use DateAdd to add the number of months in the Frequency field to the
date
in the Scheduled_Date field:
DateAdd("m", [Frequency], [Scheduled_Date])

Hi,
Please if any one can help me, I need to calculate the
Next_Scheduled_Date
according to the Frequency(that depend on the months-1 month, 2 months,
3
months...) and the Scheduled_Date(that its date for exm-1/2/2007). I
need
that in the Next_Scheduled_Date will be the sum of Scheduled_Date and
the
Frequency(the months). I'm tring to do it in DateSerial formula, but it
giving me Errors.
 
Thanks it worked, but now when I want to conect it to the table it is giving
me an error-"Syntax error(comma) in query expression
'[tbl_PM's].[Dateadd("m",[Month],[Scheduled_Date])]'
(I changed the Frequency field to the Month field)
I hope you can help me, what I'm doing wrong?

Allen Browne said:
Anna, do you have a field named Scheduled_Date?

Use the name of the field you want to add x months to.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Anna said:
Thanks, but it's asking me to "Enter parameter value of Scheduled_Date"
and
not calculating automaticly?

Allen Browne said:
Use DateAdd to add the number of months in the Frequency field to the
date
in the Scheduled_Date field:
DateAdd("m", [Frequency], [Scheduled_Date])

Hi,
Please if any one can help me, I need to calculate the
Next_Scheduled_Date
according to the Frequency(that depend on the months-1 month, 2 months,
3
months...) and the Scheduled_Date(that its date for exm-1/2/2007). I
need
that in the Next_Scheduled_Date will be the sum of Scheduled_Date and
the
Frequency(the months). I'm tring to do it in DateSerial formula, but it
giving me Errors.
 
If it is complaining about the comma, perhaps you have a different character
chosen as your List Separator in the Windows Control Panel (under Regional
Options.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Anna said:
Thanks it worked, but now when I want to conect it to the table it is
giving
me an error-"Syntax error(comma) in query expression
'[tbl_PM's].[Dateadd("m",[Month],[Scheduled_Date])]'
(I changed the Frequency field to the Month field)
I hope you can help me, what I'm doing wrong?

Allen Browne said:
Anna, do you have a field named Scheduled_Date?

Use the name of the field you want to add x months to.

Anna said:
Thanks, but it's asking me to "Enter parameter value of Scheduled_Date"
and
not calculating automaticly?

:

Use DateAdd to add the number of months in the Frequency field to the
date
in the Scheduled_Date field:
DateAdd("m", [Frequency], [Scheduled_Date])

Hi,
Please if any one can help me, I need to calculate the
Next_Scheduled_Date
according to the Frequency(that depend on the months-1 month, 2
months,
3
months...) and the Scheduled_Date(that its date for exm-1/2/2007). I
need
that in the Next_Scheduled_Date will be the sum of Scheduled_Date
and
the
Frequency(the months). I'm tring to do it in DateSerial formula, but
it
giving me Errors.
 
Thanks it worked, but now when I want to conect it to the table it is giving
me an error-"Syntax error (comma) in query expression
'[tbl_PM's].[Dateadd("m",[Month],[Scheduled_Date])]'

AFAIK that's not legal syntax. If you want to add a table qualifiers
(prefix) to your columns, try:

DATEADD("M", [tbl_PM's].[Month], [tbl_PM's].[Scheduled_Date])

Jamie.

--
 
Thanks, but still something is wrong: this expr. is working, but the tbl name
is not displayed in the query and are not updating on the tbl_PM's. And when
I try to force the tbl in the query by manualy choosing it, it's giving me an
error:Syntax error in query expression
'[tbl_PM's].[DateAdd("m",[tbl_PM's]].[Month],[tbl_PM's].[[Scheduled_Date])]'.
What I'm doing wrong?
Thanks,
Anna

Jamie Collins said:
Thanks it worked, but now when I want to conect it to the table it is giving
me an error-"Syntax error (comma) in query expression
'[tbl_PM's].[Dateadd("m",[Month],[Scheduled_Date])]'

AFAIK that's not legal syntax. If you want to add a table qualifiers
(prefix) to your columns, try:

DATEADD("M", [tbl_PM's].[Month], [tbl_PM's].[Scheduled_Date])

Jamie.
 
Thanks, but still something is wrong: this expr. is working, but the tbl name
is not displayed in the query and are not updating on the tbl_PM's. And when
I try to force the tbl in the query by manualy choosing it, it's giving me an
error:Syntax error in query expression
'[tbl_PM's].[DateAdd("m",[tbl_PM's]].[Month],[tbl_PM's].[[Scheduled_Date])]­'.
What I'm doing wrong?

Try replacing

[tbl_PM's].[DateAdd("m",[tbl_PM's]].[Month],[tbl_PM's].
[[Scheduled_Date])]

with

DateAdd("m",[tbl_PM's].[Month],[tbl_PM's].[Scheduled_Date])

Jamie.

--
 
I tries that, but that way it's not connected to the tbl_PM's.

Jamie Collins said:
Thanks, but still something is wrong: this expr. is working, but the tbl name
is not displayed in the query and are not updating on the tbl_PM's. And when
I try to force the tbl in the query by manualy choosing it, it's giving me an
error:Syntax error in query expression
'[tbl_PM's].[DateAdd("m",[tbl_PM's]].[Month],[tbl_PM's].[[Scheduled_Date])]­'.
What I'm doing wrong?

Try replacing

[tbl_PM's].[DateAdd("m",[tbl_PM's]].[Month],[tbl_PM's].
[[Scheduled_Date])]

with

DateAdd("m",[tbl_PM's].[Month],[tbl_PM's].[Scheduled_Date])

Jamie.
 
I tries that, but that way it's not connected to the tbl_PM's.

Please post the SQL view of the query (the one that works) and
indicate where you want the DATEADD() to be inserted. TIA.

Jamie.

--
 
Back
Top