I have a query that returns all the orders the were closed during a given week, and all the orders that are still open.
Then I have a report based on that query, that lists all the orders by the date. The report looks perfect except for the open orders, which of course do not have a date closed.
So open orders show up as #type! for their date.
For those orders, I would like to replace the closing date, which doesn't exist, with the date the order was opened.
I'm not sure how to deal with this. Do I need a if/then function in my query to replace null closing date, with open date?
Or do I need an expression in the report itself to replace null closing, with the open date?
Or do I need to have a sub-report that uses an open order query which already exists, inside my existing report?
What do more experienced people recommend?
Phil,
For proper Syntax, IsNull() needs to evaluate just the Date, without additional arguments (and i remived the "Not" for clarity's sake: - NewClosingDate: IIf(IsNull(ClosingDate), OpenDate, ClosingDate)
Or: - NewClosingDate: IIf(IsNull(ClosingDate), "", ClosingDate)
However, Null Dates should not display with #Type ; they should simply be blank. If we fix that problem first, then we can choose to display the Open date instead (but I think that would be confusing for anyone reading the report).
5 1236
Andre77k,
Welcome to Bytes!
Something sounds wrong with your Query itself. If you are including a Date Field, and it happens to be Null, then it will show up as Blank on your Report. Are you trying to manipulate the Date somehow?
It would be helpful to include your query here and we can take a look at it.
In your query you have several options.
Add a new field "NewClosingDate" -
NewClosingDate: Iif Not IsNull(ClosingDat, ClosingDate, OpenDate)
-
Or to my mind, better still as it will give a blank NewClosingDate -
NewClosingDate: Iif Not IsNull(ClosingDat, ClosingDate, "")
-
Your report obviously uses the NewClosingDate
Phil
Phil,
For proper Syntax, IsNull() needs to evaluate just the Date, without additional arguments (and i remived the "Not" for clarity's sake: - NewClosingDate: IIf(IsNull(ClosingDate), OpenDate, ClosingDate)
Or: - NewClosingDate: IIf(IsNull(ClosingDate), "", ClosingDate)
However, Null Dates should not display with #Type ; they should simply be blank. If we fix that problem first, then we can choose to display the Open date instead (but I think that would be confusing for anyone reading the report).
That was the answer I was looking for. - IIf(IsNull([DateOut]),[DateIn],[DateOut]) AS FinDate
This ended up being my exact solution, based on your both of your posts. Thank you.
I'm glad we could find a solution you can work with.
Did we ever figure out why the dates were displaying so strangely in the Report?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: |
last post by:
Sql server 7
There will be times when the user will not be required to supply a value for
the calling asp script that pass values to an sql server Sp.
How can I handle these null or empty...
|
by: Johannes Hansen |
last post by:
What are the best practice on handling an exception caused by a Dispose
method when its called from inside a loop? Wrap the entire loop in a
try-catch or do the try-catch on each iteration to get...
|
by: |
last post by:
I have an app that retrieves data from an Access database. At the moment I
have the SQL string as a Const in my app. I understand this is not best
practice. I don't want the user to have access to...
|
by: Bryan Hepworth |
last post by:
Hi Everyone
I'm wondering what the best practice is for a particular task I'm trying to
accomplish. I'm using two sets of radio buttons for a user to select values
from. These values then go...
|
by: Bob Alston |
last post by:
Is it considered best practice to distribute FE databases as MDEs rather
than MDBs? Without flaming me for asking the question, could someone
please enumerate the key advantages?
Also I like to...
|
by: =?Utf-8?B?bW9mbGFoZXJ0eQ==?= |
last post by:
In VB6, we created a number of ActiveX DLLs that all shared a similar
interface. The main application would load these in dynamically (late-bound.)
This worked well for our situation because we...
|
by: G |
last post by:
Hello,
Looking for opinions on a fairly simple task, new to ASP.net (C#) and want
to make sure I do this as efficiently as possible.
I have a web based form, and I need to run some SQL before...
|
by: Steve |
last post by:
I am building an object library for tables in a database. What is the
best practice for creating objects like this?
For example, say I have the following tables in my database:
User:
- Id
-...
|
by: Peter Larsen [CPH] |
last post by:
Hi,
I'm looking for some "best practice" help related to web applications and
recources (images, strings, files etc).
In Windows Forms Applications its normal to save all kinds of resources in...
|
by: fjm |
last post by:
I'd be interested in someone looking over this foreach loop to see if there is a better way to do this. These loops gives me exactly what I need but I can't help but think it isn't the best practice...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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,...
|
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...
|
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...
|
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...
| |