Convert text from db to

Results 1 to 2 of 2

Thread: Convert text from db to

  1. #1
    Join Date
    Dec 1969

    Default Convert text from db to

    I&#039;m storing a date in a database as text...because if not...when I display shows as the entire date and time....regardless of whether it&#039;s a smalldate in access or not. <BR><BR>In any case, I&#039;m storing the dates in the table as mm/dd/yyyy. <BR>in a page, I want to automatically clean up the database, by deleting all the records that have a date which is older than today. Any ideas?

  2. #2
    Join Date
    Dec 1969

    Default RE: Convert text from db to

    First of all, I&#039;d fix the date issue for this very reason...You could do this with some string functions, assuming that you store your dates in a consistent format. How many rows do you have? Maybe you could create a new column as a date, fix all the date issues, delete the old column, and then rename the new column to the old name.<BR><BR>To display the date without the time, you can use the method ".ToShortDateString" or ".ToLongDateString".<BR><BR><BR>

Posting Permissions

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