Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Posts
    21

    Angry Unanswered: Breaking apart Nemeric Data

    I have a date field that is defined as 8 positions numeric. I want to break it apart and put it into character. The example that I need is as follows:

    File Data - 20040617
    New Look - 06/17/2004

    I assume that you have to do a formula, but I can;t find the right one to do it. Does anyone know how to change to file data to look like the "New Look" Any help would be greatly appreciated!!

    Thank in adnvance!!!

  2. #2
    Join Date
    Jun 2004
    Posts
    10
    Try something like this (Basic syntax):

    dim day as number
    dim month as number

    dim date as number 'The original date
    dim strDate as string 'The new look

    'First we "filter out" the day
    date = date / 100 'date now looks like 200406.17
    day = 100 * (date - int(date) ) 'Get the decimal part as the day
    date = date - (day / 100 ) 'Remove the decimal part from the date, so you have 200406

    'Now filter out the month
    date = date / 100 'date now looks like 2004.06
    month = 100 * (date - int(date) ) 'Get the decimal part as the month
    date = date - ( month / 100 )
    'Now only the year is left in date

    'Concatinate the elements into a date string
    strDate = ToText(month, 0) & "/"
    strDate = strDate & ToText(day, 0) & "/"
    strDate = strDate & ToText(date)

    'Return the date string
    Formula = strDate

    I didn't test this, but I think it should work. Good luck.

  3. #3
    Join Date
    Apr 2004
    Posts
    21
    Thanks a bunch. That worked great!!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •