Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Problem! 1

Status
Not open for further replies.

Smitty020

MIS
Jun 1, 2001
152
US
I am pulling employee information from an Access2000 DB! In the table that I need the info from, the DOB, HireDate, ect are not entered as one date field. They are entered as three text fields. Like:

BirthDate Month
BirthDate Day
BirthDate Year

Is there a way to combine these fields in ASP so that I would see the following:

If in the DB it was:
BirthMo was 4
BirthDy was 10
BirthYr was 1971 (year is "yyyy")

I would see:

4/10/1971 or 4/10/71 on the ASP?

I am new to ASP, so any advice would be greatly appreciated!

Thanks in advance!

Smitty

 
Hi Smitty,

To display "4/10/1971" do
Response.Write(BirthMo & "/" &BirthDy& "/" & BirthYr)

and to display "4/10/71" do
Response.Write(BirthMo & "/" &BirthDy& "/" & Left(BirthYr,2))

hope this helps, Chiu Chan
WebMaster & Software Engineer
emagine solutions, inc
cchan@emagine-solutions.com
 
Thanks Chiu, I have a few dates that I need to convert like this! This will help me out alot!

Thanks Again!

Smitty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top