A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Data Conversion Expression returning an #Error



 
 
Thread Tools Display Modes
  #1  
Old November 20th, 2009, 03:28 PM posted to microsoft.public.access.queries
D. Stacy
external usenet poster
 
Posts: 14
Default Data Conversion Expression returning an #Error

Looking for some guidence on how to get this expression out sick bay!

The [Cut_Time] data field comes from a legacy system and may or may not have
data in it, may or may not be 0 thru 5 char in length, comes in formatted as
text data. The data represents a time stamp of an activity expressed in
military time.

The goal is to convert it to the DateTime format IF it has any entry at all;
IF blank just output a null.





CutT_temp:
CDate(IIf(IsError(FormatDateTime(IIf(Len([Cut_Time])1,"",Left([Cut_Time],2)+":"+Right([Cut_Time],2)),0)),"",FormatDateTime(IIf(Len([Cut_Time])1,"",Left([Cut_Time],2)+":"+Right([Cut_Time],2)),0)))
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:43 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.