Why doesn't this work: =DateAdd("m",36,[Initial QNFT Date])

  • Thread starter Thread starter Wenzell
  • Start date Start date
W

Wenzell

I am trying to do a date calculation in an Access 2003 query. I want to add
36 months to the Initial QNFT Date. What am I doing wrong?

Thank you.
 
What result do you get?

What is [Initial QNFT Date]?
Is it a date/time field in a table?
A Text field?
A calcualted query field?
A text box?

In what context are you doing this?
Query field?
Control source of a text box in a form?
In a report?
 
My query was written this way: =DateAdd("m",36,[Initial QNFT Date]) where
Initial QNFT Date is a date/time field in a table. It's been a while since
I've tried to do this and never in Access 2003. I don't know what I've done
wrong. Thank you.

Allen Browne said:
What result do you get?

What is [Initial QNFT Date]?
Is it a date/time field in a table?
A Text field?
A calcualted query field?
A text box?

In what context are you doing this?
Query field?
Control source of a text box in a form?
In a report?

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

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

Wenzell said:
I am trying to do a date calculation in an Access 2003 query. I want to
add
36 months to the Initial QNFT Date. What am I doing wrong?

Thank you.
 
I neglected to mention that when I ran the query, there were no results.

Allen Browne said:
What result do you get?

What is [Initial QNFT Date]?
Is it a date/time field in a table?
A Text field?
A calcualted query field?
A text box?

In what context are you doing this?
Query field?
Control source of a text box in a form?
In a report?

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

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

Wenzell said:
I am trying to do a date calculation in an Access 2003 query. I want to
add
36 months to the Initial QNFT Date. What am I doing wrong?

Thank you.
 
So this expression is being used as criteria in your query?

What are you applying the criteria against? Hopefully not against the
[Initial QNFT Date] field, since that will never be equal to itself plus
36 months.

May I suggest that you post the entire SQL statement. In design view,
select VIEW: SQL from the menu and copy the text and post that for analysis.

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

I neglected to mention that when I ran the query, there were no results.

Allen Browne said:
What result do you get?

What is [Initial QNFT Date]?
Is it a date/time field in a table?
A Text field?
A calcualted query field?
A text box?

In what context are you doing this?
Query field?
Control source of a text box in a form?
In a report?

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

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

Wenzell said:
I am trying to do a date calculation in an Access 2003 query. I want to
add
36 months to the Initial QNFT Date. What am I doing wrong?

Thank you.
 
As per your request, in SQL view, it reads:

ELECT [Demographics Table].[Last Name], [Demographics Table].[First Name],
[Demographics Table].[Last 4 of SSN], [Demographics Table].Unit,
[Demographics Table].Workplace, [Demographics Table].[Initial QNFT Date],
[Demographics Table].[Minimum for Next QNFT]
FROM [Demographics Table]
WHERE ((([Demographics Table].[Minimum for Next
QNFT])=DateAdd("m",36,[Initial QNFT Date])));

John Spencer said:
So this expression is being used as criteria in your query?

What are you applying the criteria against? Hopefully not against the
[Initial QNFT Date] field, since that will never be equal to itself plus
36 months.

May I suggest that you post the entire SQL statement. In design view,
select VIEW: SQL from the menu and copy the text and post that for analysis.

'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

I neglected to mention that when I ran the query, there were no results.

Allen Browne said:
What result do you get?

What is [Initial QNFT Date]?
Is it a date/time field in a table?
A Text field?
A calcualted query field?
A text box?

In what context are you doing this?
Query field?
Control source of a text box in a form?
In a report?

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

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

I am trying to do a date calculation in an Access 2003 query. I want to
add
36 months to the Initial QNFT Date. What am I doing wrong?

Thank you.
 
Back
Top