Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 13th, 2004, 06:22 PM
Registered User
 
Join Date: Dec 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default ColdFusion, Using Access DB

Hello There
I am trying to create a project number that does appear on my submittal form and it consists of 3 parts(i.e. 4 SE-123)the 1st digit represent the year the next 2 letter are representing the department and the last 3 digits are ID autonumber from the table. The project number will be used in the search page and also to refer to corresponding word doc. I tried these codes and I get the error message. Please tell me what exactly my problem is.

<cfquery name="MaximumID" datasource="Capital2Reqs">
SELECT MAX (ID) FROM Capital2_Inputs
</cfquery>

<cfquery name="ProjectNumber" datasource="Capital2Reqs">
SELECT (4 + '#Form.Departments#' + '-' + Max (ID)) AS Project_No FROM Capital2_Inputs
</cfquery>

<CFQUERY NAME="UserInsert" DATASOURCE="Capital2Reqs" >
INSERT INTO Capital2_Inputs (Project_No,Div_Priority,Status,Just_Detail,Divisi
on,Departments,Org_Number,Org_Name,Director)
VALUES ('#Project_No#','#Form.Div_Priority#','#Form.Statu s#','#Just_Detail#','#Form.Division#','#Form.Depar tments#','#Form.Org_Number#','#Form.Org_Name#','#F orm.Director#');
</CFQUERY>

THE ERROR MESSAGE IS:
ODBC Error Code = 22005 (Error in assignment)
[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
SQL = "SELECT (4 + 'AR' + '-' + Max (ID)) AS Project_No FROM Capital2_Inputs"
Data Source = "CAPITAL2REQS"
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (52:1) to (52:56).







Similar Threads
Thread Thread Starter Forum Replies Last Post
Ajax with coldfusion crishna BOOK: Beginning Ajax with ASP.NET 0 January 25th, 2008 02:26 AM
Coldfusion/web services help NeilS21 Other Programming Languages 0 December 27th, 2005 04:39 PM
Converting Access DB to Online DB eyal8r Access 5 December 6th, 2004 05:22 AM
access db to sql server db mikersantiago Classic ASP Basics 4 November 16th, 2004 03:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.