evergrean100
Technical User
I have a Form with an POC Firstname, POC Lastname and Expert Firstname and Expert Lastname.
Sometimes the POC and Expert are the same person.
My Access 2003 table (ContactTable ) looks like this:
Now for the Insert Query I need help because not sure if this is the best way to do this:
Sometimes the POC and Expert are the same person.
Code:
<form ....>
POC firstname: <input name="pocFirstname"....>
POC lastname: <input name="pocLastname"....>
Expert firstname: <input name="expertFirstname"....>
Expert lastname: <input name="expertLastname"....>
</form>
My Access 2003 table (ContactTable ) looks like this:
Code:
contact_id -> primary key
firstname
lastname
poc
expert
Now for the Insert Query I need help because not sure if this is the best way to do this:
Code:
<cfif form.pocFirstname neq form.expertFirstname and form.pocLastname neq form.expertLastname>
INSERT INTO ContactTable
(firstname, lastname,poc,expert)
VALUES
('#form.pocFirstname#', '#form.pocLastname#','yes','no');
INSERT INTO ContactTable
(firstname, lastname,poc,expert)
VALUES
('#form.expertFirstname#', '#form.expertLastname#', 'no','yes');
<else>
<!--- POC and Expert are the same person so I can use poc (or expert) form entry for the SQL insert --->
INSERT INTO ContactTable
(firstname, lastname,poc,expert)
VALUES
('#form.pocFirstname#', '#form.pocLastname#', 'yes','yes');
</cfif>