TypeMismatch when Converting number yyyymmdd to mm/dd/yyyy

I need to convert a number/date field from yyyymmdd to mm/dd/yy and I am getting a data type mismatch.

HIRE_DATE: DateSerial(Left$([EFFECT_HIRE_DATE],4),Mid$([EFFECT_HIRE_DATE],5,2),Right$([EFFECT_HIRE_DATE],2))

what am I missing
Karen SchaeferBI ANALYSTAsked:
Who is Participating?
 
mbizupCommented:
Try explicitly converting to a numeric datatype:

HIRE_DATE: DateSerial(CInt(Left([EFFECT_HIRE_DATE],4)),CInt(Mid([EFFECT_HIRE_DATE],5,2)),CInt(Right([EFFECT_HIRE_DATE],2)))

Open in new window

0
 
Karen SchaeferBI ANALYSTAuthor Commented:
What needs to be modified to be able to handle null value -
0
 
Karen SchaeferBI ANALYSTAuthor Commented:
thanks that did it.

K
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.