473,503 Members | 1,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

# Error Returned for Date

4 New Member
I am joining two queries. I have the following logic to deal with "null" dates, with the hope that it will return a null value rather than #Error. To my dismay it does not seem to work.

Here is the formula I am using:
Requisitioning Date: IIf(Requisition.[Requisitioning Date] Is Null,Null,Requisition.[Requisitioning Date])

Here is the result:
Requisition ID
PR4289 10/21/2008
PR6271 #Error
PR2816 10/06/2008

Any assistence is appreciated.
jason
Mar 23 '09 #1
5 1313
Dan2kx
365 Contributor
Expand|Select|Wrap|Line Numbers
  1. IIf(Is Null(Requisition.[Requisitioning Date]),Null,Requisition.[Requisitioning Date])
i believe the correct syntax would be (above) but i havent tested.

but can i ask, if you want the value to display null would it not already if it was null? if so then i guess that would not work! you would need to display something else in your 'true' field,

eg, 0 or maybe '' (empty single quote (x2))

if this does not satisfy then you will have to wait for an expert
Mar 23 '09 #2
RuralGuy
375 Recognized Expert Contributor
Your code is equivalent to just returning the field.
Mar 23 '09 #3
Stewart Ross
2,545 Recognized Expert Moderator Specialist
Hi Jason.

The #Error indicates a problem with either the name of a field or the value fed to a function.

Your original #Error message most likely results from conflicting names for the same field - you cannot have a calculated field named the same as any of the fields it is referring to within it (Requisitioning Date in this case), although I see that you have qualified the name with the tablename concerned (Requisition).

However, as RuralGuy says, your IIF is doing no more than returning the current value for the date from Requisitioning Date, or Null if it is null. This is what a direct reference to the same field would do without using an IIF, so your IIF is not helping at all.

Could you post the SQL for the query in which you are referring to this field, so we can see what you are trying to achieve, along with perhaps some examples to help us visualise the values more clearly?

-Stewart
Mar 24 '09 #4
Jlayne
4 New Member
Thank you. This has been helpful and my problem is resolved.

My original query used subqueries as its datasource. To correct my problem I changed my subqueries to "Make Table" queries, then used the newly created tables as my datasource. Simply using Tables rather than Queries as my source records corrected the problem. Is there any reason why this would make a difference?

As for the logic: I was linking invoice data and requisition data. There can be zero to many invoices for each requistion. I should have explained further that requistion date was only one of the date fields I was capturing. The other was a "Control Date" which i wanted to equal the Requisition Date, if it existed, otherwise it would be the Invoice date.

Thanks again for your help.
jason
Mar 24 '09 #5
RuralGuy
375 Recognized Expert Contributor
Glad to hear you got it sorted.
Mar 24 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
16217
by: Tony Wright | last post by:
Hi, I am having a problem installing an msi for a web site. The error message I am getting is: "The specified path 'http://mipdev05/features/Fas2' is unavailable. The Internet Information...
6
4712
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
6
2762
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
4
5140
by: James | last post by:
Please help me with this sql: SELECT z005aNORTHEAST_3days_Formula.Region, z005aNORTHEAST_3days_Formula.DiffofClaimsAssignment FROM (SELECT .Region, (.)-( .) AS DiffofClaimsAssignment FROM...
5
514
by: Tony Wright | last post by:
Hi, I am having a problem installing an msi for a web site. The error message I am getting is: "The specified path 'http://mipdev05/features/Fas2' is unavailable. The Internet Information...
0
7339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7463
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3157
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1515
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.