I have two query expressions which works separately:
Days1: - IIf(IsNull([DateSold]),Date()-[DateBuy],Workdays([DateBuy],[DateSold]))
Day4: - Workdays([DateBuy],Date())
but when combined it does not work - too many arguments:
Days5: - IIf((IsNull([DateSold]),Workdays([DateBuy],Date()),Workdays([DateBuy],[DateSold])))
what is the solution please?
As Rabbit says, it should be : - Days5: IIf(IsNull([DateSold]),Workdays([DateBuy],Date()),Workdays([DateBuy],[DateSold]))
An alternative approach might be : - Days5: Workdays([DateBuy],Nz([DateSold],Date()))
5 1673
You have an extra set of outside parentheses on your Days5 expression.
NeoPa 32,556
Expert Mod 16PB
As Rabbit says, it should be : - Days5: IIf(IsNull([DateSold]),Workdays([DateBuy],Date()),Workdays([DateBuy],[DateSold]))
An alternative approach might be : - Days5: Workdays([DateBuy],Nz([DateSold],Date()))
Thank you Rabbit for the solution.
I like the Nz suggestion, much neater. Thanks for that NeoPa.
NeoPa 32,556
Expert Mod 16PB Sign in to post your reply or Sign up for a free account.
Similar topics
by: Westcoast Sheri |
last post by:
When I used the "date("nj")" function to generate an invoice, about 1
out of 500 times, nothing comes up
<?php
$invoicedate = date("nj");
?>
<html><head></head><body>
Invoice date:
<?php...
|
by: evolve |
last post by:
why doesn't c# seem to support some kind of 'null date'
for instance:
i have an application where the user is not obliged to enter a date until
an event happens (e.g. a bug was fixed on xyz)
...
|
by: Vern |
last post by:
I'm using the Microsoft Enterprise Data Access block to call the stored
procedure. One of the values the stored procedure returns is the stop date.
When the stop date is null, the program crashes....
|
by: SirPoonga |
last post by:
I need a workday function like excel has. I found vba code for access
to dot he task. I want to try and convert it. One of the funcitosn
has the parameter "Optional dtmDate as Date = 0". I need...
|
by: Dean Slindee |
last post by:
I am looking for the "right" way to handle inserting and presenting null
date values.
Public Const c_NullDate As Date = #12:00:00 AM#
If I set the value of a date variable in an SQL Server insert...
|
by: GB |
last post by:
Is there a function to set a null date in vb.net? Normally, I create a
const NULLDATE = "1/1/1900", but that becomes a drag at times. Especially,
handling a nulldate from SQL into a dataset.
...
|
by: Brad |
last post by:
If I need to assign a NULL value to a date variable, how would I go about
doing that? For right now I am using 01-01-2001, however I don't want to use
a "real" date if the date should really be...
|
by: Ronald S. Cook |
last post by:
When I pass a null date from my client to my service project, it comes
across as #12:00:00 AM#. While I can easily code for this, it seems like a
hack. Is this normal?
I'm using WCF, by the...
|
by: klove1209 |
last post by:
Good afternoon,
I am currently working on this unbounded form that has numerous date fields. I wanted to know if it is possible to save data in a form, with a null date field. I am currently...
|
by: mwittekiend |
last post by:
I am trying to convert a NULL date to a Y/N flag. It is giving me a conversion error. Here is the code. Any help is appreciated. Thanks
'CommitDateTimeFlag' = (case when CommitDateTime IS NULL...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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: 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...
|
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...
| |