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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date-Concatenate muddle.. 1

Status
Not open for further replies.

Extras

Technical User
Joined
Nov 16, 2001
Messages
232
Location
US
I have drop down boxes that enable a person to select a date, month and a year. I then concatenate the string to deliver data that is then inserted into a date/time field in Access.

All was fine until I realized the field was only inserting 12/30/1899 as the date into the table.

Here is the code as it is processed in various sections.

CONCATENATE-CODE
<CFSET variables.DOBDate = form.ProspForm_DOB_Mth&&quot;/&quot;&form.ProspForm_DOB_Dt&&quot;/&quot;&form.ProspForm_DOB_Yr>


DATA INSERT CODE
<CFQUERY NAME=&quot;Insert&quot; DATASOURCE=&quot;DSN&quot;>
INSERT INTO ProsFormList (ProspForm_DOB,...)
VALUES (#variables.DOBDate#,...)


Now, because I display the form enteries before the use can confir the data and the submit them into the database, i know the submitted values for month, date and year are being retained until they get entered into the database - so I have a screw up somewhere in my concatenation code or the date insert code.

Any advice would be greatly appreciated!
 
I take it by the date you're getting back that you're using a file-based datasource like FoxPro or Access. (SQL uses '01/01/1900' as its null date.)

You're passing a mathematical operation, not a date.

Divide 9 by 25; divide 25 by 2002. The result is so small as to be interpreted as zero, which is the null date.

Try CreateODBCDate(variables.DOBDate) and see what happens.

HTH,
PH
 
Worked like a charm - thanks!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top