hi
In the below command I like to know can I combine it with the IIf function.
I am checking to see if NSCHD is blank. If it is blank I would place "no date"
in the place of the result..
"Starts In " & DateDiff("d",Format(Date(),"mm/dd"),Format([NSCHD],"mm/dd")) & " Days"
Thanks
bg
5 2579
Hi
hi
In the below command I like to know can I combine it with the IIf function.
I am checking to see if NSCHD is blank. If it is blank I would place "no date"
in the place of the result..
"Starts In " & DateDiff("d",Format(Date(),"mm/dd"),Format([NSCHD],"mm/dd")) & " Days"
Thanks
bg
You don't say where you are using this but I thing this would be better, it may even work!
"Starts In " & DateDiff("d",Date(),[NSCHD]) & " Days"
Why format it as you actualy state "Starts in xx Days" and the fuction is set to return days ??
Note days will not format as mm/dd correctly (I believe).
MTB
I'd use a simple If...Then construct rather than IIF simply because it's easier to tell at a glance what's going on, and using expressions within IFF can get complicated with hard to spot errors resulting . Also, there's no need to use formatting on your dates in the DateDiff function; you're returning a number of days, not a date. I'd do something like this: - If IsNull(NSCHD) Then
-
"No Date"
-
Else
-
"Starts In " & DateDiff("d",Date,NSCHD) & " Day(s)"
-
End If
-
Good Luck!
Linq ;0)>
hi
In the below command I like to know can I combine it with the IIf function.
I am checking to see if NSCHD is blank. If it is blank I would place "no date"
in the place of the result..
"Starts In " & DateDiff("d",Format(Date(),"mm/dd"),Format([NSCHD],"mm/dd")) & " Days"
Thanks
bg
Yha, you can use it like - "Starts In " & iif(DateDiff("d",Date,NSCHD) = 0,"No",DateDiff("d",Date,NSCHD)) & " Days"
but if Mike's qurey is workink then you can use that,
Didn't mean to step on your toes, Mike! Had to take the dog out between starting and ending my response. Actually the DateDiff will run with the dates formatted, it's just not necessary! ;0)>
Hi missinglinq
Didn't mean to step on your toes, Mike! Had to take the dog out between starting and ending my response. Actually the DateDiff will run with the dates formatted, it's just not necessary! ;0)>
That is not a problem, anything can happen between staring a post and submitting it, and offen does!
I have never tried formatting a date inside DateDiff, had no reason to (yet!), but I will take your word for it.
MTB
Sign in to post your reply or Sign up for a free account.
Similar topics
by: CJM |
last post by:
I have an ASP page that lists files and folders in a directory. I'm using a
cookie to record the last time this page was visited, and I intend to show
links that are created/modified from that date...
|
by: inamori |
last post by:
I face that problems
07/01/2003 06/30/2006 ---------> it should be 3
01/01/2003 02/28/2005 --------->could i get 2 years and 2 months
01/01/2003 03/01/2005 ...
|
by: Lofty |
last post by:
Hi all.
I have to write an app that interacts with mySQL (I really must have done
some evil, evil stuff in a previous life to be landed with this!)
I need to work out the difference in days...
|
by: intl04 |
last post by:
I'm trying to set up a query that will include a new field ('Days
until completion') whose value is derived from the DateDiff function.
I think I have the syntax correct but am not sure.
Days...
|
by: Paolo |
last post by:
I am having some problem with a Year Function.
I have form on which I have 4 field which indicate dates and an
additional form which sums those dates:
These are the fields:
YEARS...
|
by: PMBragg |
last post by:
ORINGINAL Post
>Thank you in advance. I'm trying to pull all inventory items from December
>of the previous year back to 4 years for my accountant. I know this can be
>done, but I'm drawing a...
|
by: Adrian |
last post by:
I hit on this problem converting a VB.NET insurance application to C#.
Age next birthday calculated from date of birth is often needed in
insurance premium calculations.
Originally done using...
|
by: sr |
last post by:
Anyone know of a better way to simulate a datediff for C#, i.e.,
without referencing the VB.NET runtime?
Only added the functionality that was needed for me so it is not
the full implementation...
|
by: kevinjwilson |
last post by:
I am trying to get the date difference between two dates but I don't
want the function to include weekends in the calculation. Does anyone
have an idea on how to make this work?
|
by: muddasirmunir |
last post by:
i am using vb 6 , i had place two datepicker in form now i want to calcuate differcen of month in two date for this i used the function datediff
i had try it withh many syntax but getting error...
|
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: 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: 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: 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: 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: 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: 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...
|
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,...
| |