Help with DateAdd

G

Guest

I am working on a database which tracks the renewal date of agreements
established between international non-profit organizations and their funding
sources. The database tacks the DATE OF SIGNATURE OF THE AGREEMENT, DATE OF
PUBLICATION OF THE AGREEMENT, and PERIOD OF TIME UNTIL THE NEXT RENEWAL (i.e.
days, weeks, months, or years). The renewal of the agreements can be
established from the DATE OF SIGNATURE or from the DATE OF PUBLICATION.

To calculate the renewal date of each agreement, I created SQL statements
testing each of the scenarios (if renewal is going to be on days, weeks,
months or years and from Pub. date and/or Sign. Date). Afterwards, I
connected these independent SELECT queries into a UNION query. Below, I
transcribe an example of the code used to compute the renewal of the
agreement based on its publication date:

SELECT *, format((DateAdd("m",[Deadline],[PublicationDate])),"dd/mm/yyyy")
AS DeadlineDate
FROM tblObjet
WHERE (((Deadline_from_Publication)=Yes) AND ((DeadlinePeriod)="month(s)"));

The DeadlineDate is calculated; however, MS ACCESS is not recognizing the
information generated as a DATE; therefore, I am unable to sort my deadline
dates in ascending or descending order. For some unknown reason to me, my
dates are been identified as TEXT.

Can somebody please help me? Thank you in advance!
 
G

Guest

Ofer said:
The Format change the date in to text field, use the CvDate to convert it
back to date

CvDate(Format([DateField],"dd/mm/yyyy"))

--
\\// Live Long and Prosper \\//
BS"D


Eneida said:
I am working on a database which tracks the renewal date of agreements
established between international non-profit organizations and their funding
sources. The database tacks the DATE OF SIGNATURE OF THE AGREEMENT, DATE OF
PUBLICATION OF THE AGREEMENT, and PERIOD OF TIME UNTIL THE NEXT RENEWAL (i.e.
days, weeks, months, or years). The renewal of the agreements can be
established from the DATE OF SIGNATURE or from the DATE OF PUBLICATION.

To calculate the renewal date of each agreement, I created SQL statements
testing each of the scenarios (if renewal is going to be on days, weeks,
months or years and from Pub. date and/or Sign. Date). Afterwards, I
connected these independent SELECT queries into a UNION query. Below, I
transcribe an example of the code used to compute the renewal of the
agreement based on its publication date:

SELECT *, format((DateAdd("m",[Deadline],[PublicationDate])),"dd/mm/yyyy")
AS DeadlineDate
FROM tblObjet
WHERE (((Deadline_from_Publication)=Yes) AND ((DeadlinePeriod)="month(s)"));

The DeadlineDate is calculated; however, MS ACCESS is not recognizing the
information generated as a DATE; therefore, I am unable to sort my deadline
dates in ascending or descending order. For some unknown reason to me, my
dates are been identified as TEXT.

Can somebody please help me? Thank you in advance!
Thank you! I have implemented your suggestion. Now, my database works
perfectly.
 

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