seperating date fields

Results 1 to 3 of 3

Thread: seperating date fields

  1. #1
    Join Date
    Dec 1969

    Default seperating date fields

    If I am querying a datetime field from the database, and this field has both the date and the time in it, is there any way that i can split it into two string fields, one as just the date and one as the time?

  2. #2
    Join Date
    Dec 1969

    Default RE: seperating date fields

    Here&#039s one way...<BR><BR>dim nspace, mydate, mytime<BR><BR>nspace = instr (mydatetime, " ")<BR>mydate = left (mydatetime, nspace - 1)<BR>mytime = mid (mydatetime, nspace + 1)<BR><BR>date(mydatetime) will also give you the date, but I don&#039t think there&#039s an equivalent function for only the time part.

  3. #3
    fddggfdgfdgfd Guest

    Default RE: seperating date fields

    Another way assuming format of space delimited between date and time:<BR><BR>sDT = Split(yourString, " ")<BR>sDate = sDT(0)<BR>sTime = sDT(1)

Posting Permissions

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