Results 1 to 2 of 2

Thread: Pulling parts of a date from a SQL table using VB

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2003
    Location
    Phoenix, AZ
    Posts
    22

    Question Pulling parts of a date from a SQL table using VB

    I've got two date fields in a SQL table, dateStarted and dateEnded. I'm trying to pull the day, month and year info from them into separate ASP textboxes (i.e. txtMth, txtDay, txtYear, txtMth2, txtDay2, txtYear2) using VB. Assuming I've already opened the SQL connection how would I proceed to populate the textboxes w/ the days, months, and years separately?
    "Ignorance and prejudice and fear walk hand in hand" - 'Witch Hunt', by Rush

  2. #2
    Hyperactive Member
    Join Date
    Aug 2002
    Posts
    416
    Retreive the data into a Date variable type, and there should be some methods you can use to extract day,month,year, etc...

    Or retrieve date into a String, and use the Split() method to seperate the parts.

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