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

Begineers need help

Status
Not open for further replies.

mktan78

MIS
Dec 7, 2000
2
MY
Here's my problem when I tried to access my database the screen will show something like this:
Error Diagnostic Information
ODBC Error Code = 37000 (Syntax error or access violation)


[Microsoft][ODBC SQL Server Driver][SQL Server]Error converting data type varchar to numeric.



The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (53:1) to (53:27).

Anyone can help me ?? One more question any idea how to create a planner using coldfusion ???
 
There might be an error in a parametre of your query.
Check it.
 
usually it comes from misquoting
a numeric is passed like this #num#
a string like this "#num#"
or post the code (for the query) if you don't find by yourself
 
Thanx for the reply but try to locate the mistake but failed!!
Here's the line:
<cfquery datasource=&quot;REMS&quot;>

INSERT INTO REMS_pat(pat_ref_yr, pat_date_d, pat_date_m, pat_date_y, pat_newspaper, datea_d,pat_datea_m,pat_datea_y, pat_time, pat_venue, pat_tnum, pat_lnum, pat_dis,pat_state, pat_country,pat_tenure, pat_la, pat_anr, pat_rown, pat_rii, pat_enc, pat_lad, pat_pricer,pat_ai)

VALUES ('#ref_year#', '#pat_date_d#', '#pat_date_m#',
'#pat_date_y#', '#pat_newspaper#','#pat_datea_d#',
'#pat_datea_m#', '#pat_datea_y#', '#pat_time#',
'#pat_venue#', '#pat_tnum#', '#pat_lnum#',
'#pat_dis#', '#pat_state#', '#pat_country#',
'#pat_tenure#', '#pat_la#',
CONVERT (MONEY, '#pat_anr#'), '#pat_rown#',
'#pat_rii#','#pat_enc#','#pat_lad#', '#pat_pricer#', '#pat_ai#')
</cfquery>


One more question how to combine the date between the day, month and year when in the database it's only one attribute! Do I need to split them up into three ??
 
maybe
CONVERT (MONEY, #pat_anr#)
(without the '')

else, try adding the debugs (in the cf admin) to see the query with 'real values' in it - often it helps

you've got day month & year and want a complete date ? <cfset the_date=#CreateDate(&quot;#year#&quot;, &quot;#month#&quot;, &quot;#day#&quot;)#>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top