Results 1 to 2 of 2

Thread: data type conversion error when moving a date from a label to a database

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Location
    Rhinelander, WI USA
    Posts
    59

    Post

    I am getting a data conversion error when i am moving a date from a label to a new db when the field is a date format do you guys have any ideas? thanks

  2. #2
    Junior Member
    Join Date
    Jul 1999
    Posts
    16

    Post

    When sending the date to the database, try formatting it into an accepted date:

    eg: (assuming VB and SQL Server.....) database.table.date_column = IIf(Trim$(Label1.Caption) <> "", Format(Label1.Caption,"dd-mmm-yyyy", vbNullString)

    Substitute "dd-mmm-yyyy" with whatever format works for you (I use this format and it always works).

    JP


Posting Permissions

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



Click Here to Expand Forum to Full Width