473,657 Members | 2,348 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,Requi sition.[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 1323
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
16244
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 Server might not be running or the path exists and is redirected to another machine. Please check the status of this virtual directory in the Internet Services Manager."
6
4739
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 appreciated. Thanks in advance
6
2768
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 appreciated. Thanks in advance
4
5154
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 (SELECT .Region, ., ., .
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 Server might not be running or the path exists and is redirected to another machine. Please check the status of this virtual directory in the Internet Services Manager."
0
8312
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8827
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8606
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4159
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2732
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 we have to send another system
2
1622
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.