Click to See Complete Forum and Search --> : Adding data to a field


anuvb
March 1st, 2003, 04:26 AM
hi

This may be a very basic question to many...
I have a form with provision for the user to enter a date.I have provided the user to select a date,month and year rom 3 diff combo boxes,but I want to store the data from all the three combo boxes in a singe date field in the database .Is it possible and how???

Thanks in advance

Have a nice day

anuvb

antares686
March 1st, 2003, 07:52 PM
Depends on the type of language and database you are using but for the most part create a string variable and concatinate into the format of a normal date and submit into a field for date time. Beyond that it would help if I knew the language and db type.

anuvb
March 2nd, 2003, 11:10 PM
Thanks for the response!
I'm using ASP as the scripting language and ms access as the database.

Have a nice day
anuvb

antares686
March 3rd, 2003, 05:20 AM
Then after you build your connection build a SQL String similar to so.


DIM SQLStr

SQLStr = "Insert Into tblNameHere (DateColNameHere) VALUES (#" & MonthVal & "/" & DayVal & "/" & YearVal & "#)"


# is the markers Access uses for Dates.

Then just execute your string on the connection object.