LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Checking Military Dates

Excel 2002, Win XP
I'm working with the new military 8 digit date system.
For instance 20030704 is 4 July 2003.
I need to check if the user entry is a valid date. I'm using:
DateFrom8 = DateSerial(Left(j, 4), Mid(j, 5, 2), Right(j, 2)) to convert the
8 digits into the intended date. The conversion works fine.
The problem is when I try to check if the user entered the 8 digits
correctly. IOW, 13 months is bad, 32 days is bad. But the above DateSerial
function will simply take the 13 months as being one month more than the
date if 12 were entered. The same with too many days. No matter what the
numbers entered, DateSerial will produce a valid date. Using
IsDate(DateSerial(...........) will always produce a True.
My question: Is there a function other than DateSerial that I can use
with IsDate to show False if the user enters too many months or days? Or is
there another way to check the validity of the date?
Obviously I can check Mid(j, 5, 2) and see if it's 12. The problem is
more with the days.
Thanks for your help. Otto


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checking Dates against Bank Holidays Gary T Excel Worksheet Functions 2 November 19th 07 03:03 PM
Spell Checking with checking cell notes jfitzpat Excel Discussion (Misc queries) 0 August 8th 07 10:26 PM
Importing dates and military time from Excel into word doc mail me MikeOneill Excel Discussion (Misc queries) 1 August 13th 06 06:51 AM
Sumproduct checking between two dates bikergsx Excel Worksheet Functions 2 May 26th 06 10:21 AM
Military time comes up? kat Excel Discussion (Misc queries) 1 March 7th 06 05:15 PM


All times are GMT +1. The time now is 08:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"