T
Tom Ellison
Dear Joe:
Shouldn't it be:
DateSerial(Year([Issue Date]), Month([Issue Date])+3),Day([Issue Date]))
Shouldn't it be:
DateSerial(Year([Issue Date]), Month([Issue Date])+3),Day([Issue Date]))
consjoe said:I am sending out quarterly statements for my customers and after the
statements go out I need to update the Send Statement date for the next
quarter. I need the Day to always be the Issue Date day and the month to add
3 everytime a statement is sent out. I also need to make sure the year will
update when appropriate.
Here is the SQL I have for my query but I can't get it to work right.
Can you let me know what I am doing wrong.
Thank You.
UPDATE Master SET Master.[Send Statement] =
DateSerial(Year(Date()),Month(Date()+3),Day([Issue Date]))
WHERE (((Master.[Quarterly Statement])=Yes) AND ((Master.Status)="ACTIVE"));
Try:
UPDATE Master
SET Master.[Send Statement] =
DateSerial("m", 3, [Issue Date])
WHERE (((Master.[Quarterly Statement])=True)
AND ((Master.Status)="ACTIVE"));
you need to work out what you want to do if the date is 30/11/2005 and
adding 3 months will NOT fall on the same day of the month, i.e.
"30/02/2006" doesn't exist. There are similar problems for other
end-of-month dates.
IMHO, the requirement for the same day of the month is rather illogical and
you will need to clarify it with whoever has the authority ...
--
HTH
Van T. Dinh
MVP (Access)
I am sending out quarterly statements for my customers and after the
statements go out I need to update the Send Statement date for the next
quarter. I need the Day to always be the Issue Date day and the month to
add
3 everytime a statement is sent out. I also need to make sure the year
will
update when appropriate.
Here is the SQL I have for my query but I can't get it to work right.
Can you let me know what I am doing wrong.
Thank You.
UPDATE Master SET Master.[Send Statement] =
DateSerial(Year(Date()),Month(Date()+3),Day([Issue Date]))
WHERE (((Master.[Quarterly Statement])=Yes) AND
((Master.Status)="ACTIVE"));
Tom Ellison said:Dear Joe:
Shouldn't it be:
DateSerial(Year([Issue Date]), Month([Issue Date])+3),Day([Issue Date]))
--
Tom Ellison
consjoe said:I am sending out quarterly statements for my customers and after the
statements go out I need to update the Send Statement date for the next
quarter. I need the Day to always be the Issue Date day and the month to add
3 everytime a statement is sent out. I also need to make sure the year will
update when appropriate.
Here is the SQL I have for my query but I can't get it to work right.
Can you let me know what I am doing wrong.
Thank You.
UPDATE Master SET Master.[Send Statement] =
DateSerial(Year(Date()),Month(Date()+3),Day([Issue Date]))
WHERE (((Master.[Quarterly Statement])=Yes) AND ((Master.Status)="ACTIVE"));
MGFoster said:consjoe said:I am sending out quarterly statements for my customers and after the
statements go out I need to update the Send Statement date for the next
quarter. I need the Day to always be the Issue Date day and the month to add
3 everytime a statement is sent out. I also need to make sure the year will
update when appropriate.
Here is the SQL I have for my query but I can't get it to work right.
Can you let me know what I am doing wrong.
Thank You.
UPDATE Master SET Master.[Send Statement] =
DateSerial(Year(Date()),Month(Date()+3),Day([Issue Date]))
WHERE (((Master.[Quarterly Statement])=Yes) AND ((Master.Status)="ACTIVE"));
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Three months or 3 days?
3 months:
SET [Send Statement] = DateAdd("m", 3, Date())
3 Days:
SET [Send Statement] = DateAdd("d", 3, Date())
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQzsOM4echKqOuFEgEQKwmgCgrkPcSq/uVFD4szLsdeZO4KvrKmkAnjRN
Jv3iWd04hG8M+bNFjGZ1dQfV
=M7qT
-----END PGP SIGNATURE-----
Van T. Dinh said:Try:
UPDATE Master
SET Master.[Send Statement] =
DateSerial("m", 3, [Issue Date])
WHERE (((Master.[Quarterly Statement])=True)
AND ((Master.Status)="ACTIVE"));
you need to work out what you want to do if the date is 30/11/2005 and
adding 3 months will NOT fall on the same day of the month, i.e.
"30/02/2006" doesn't exist. There are similar problems for other
end-of-month dates.
IMHO, the requirement for the same day of the month is rather illogical
and
you will need to clarify it with whoever has the authority ...
--
HTH
Van T. Dinh
MVP (Access)
consjoe said:I am sending out quarterly statements for my customers and after the
statements go out I need to update the Send Statement date for the next
quarter. I need the Day to always be the Issue Date day and the month to add
3 everytime a statement is sent out. I also need to make sure the year will
update when appropriate.
Here is the SQL I have for my query but I can't get it to work right.
Can you let me know what I am doing wrong.
Thank You.
UPDATE Master SET Master.[Send Statement] =
DateSerial(Year(Date()),Month(Date()+3),Day([Issue Date]))
WHERE (((Master.[Quarterly Statement])=Yes) AND ((Master.Status)="ACTIVE"));
Okay I will try that. Thank you.
I have one other question that I forgot to add the first time. I replied to
Tom also with the same question but I didn't know if you would check back
unless you had a notification of a reply.
If a contract is suspended for (an example)2 quarters and then becomes
active again I need to make sure a statement is sent out for the next
quarter. This way it will ignore the contract when status <> active but as
soon as status = active, the quarterly statement process needs to continue
from that point forward staying on the 3 month intervals of the Issue Date.
Thanks!
:
consjoe said:I am sending out quarterly statements for my customers and after the
statements go out I need to update the Send Statement date for the next
quarter. I need the Day to always be the Issue Date day and the month to add
3 everytime a statement is sent out. I also need to make sure the year will
update when appropriate.
Here is the SQL I have for my query but I can't get it to work right.
Can you let me know what I am doing wrong.
Thank You.
UPDATE Master SET Master.[Send Statement] =
DateSerial(Year(Date()),Month(Date()+3),Day([Issue Date]))
WHERE (((Master.[Quarterly Statement])=Yes) AND ((Master.Status)="ACTIVE"));
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Three months or 3 days?
3 months:
SET [Send Statement] = DateAdd("m", 3, Date())
3 Days:
SET [Send Statement] = DateAdd("d", 3, Date())
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQzsOM4echKqOuFEgEQKwmgCgrkPcSq/uVFD4szLsdeZO4KvrKmkAnjRN
Jv3iWd04hG8M+bNFjGZ1dQfV
=M7qT
-----END PGP SIGNATURE-----