• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1806
  • Last Modified:

Insert date in MS SQL

Hallo Experts.
I try to have a date when i insert an artikel in a db table.
The table is t_artikel
One column is called hersteller_pkw_id and the other is the datein.
What changes must i do in the following code which is made with  webassist-dataassist extension?
<cfif (isDefined("Form.Insert.x")) >
  <cfset WA_connection = "carfree24" />
  <cfset WA_insTable = "dbo.t_artikel" />
  <cfset WA_sessionName = "WADA_Insert_dbot_artikel" />
  <cfset WA_redirectURL = "t_artikel_Detail.cfm" />
  <cfset WA_keepQueryString = false>
  <cfset WA_indexField = "art_id" />
  <cfset WA_fieldNamesStr = "hersteller_pkw_id|Datein" />
  <cfset WA_fieldValuesStr = "" & ToString(IIf(isDefined("Form.hersteller_pkw_id"),"Form.hersteller_pkw_id",DE(""))) & "" & "|" & "" & ToString(IIf(isDefined("Form.Datein"),"Form.Datein",DE(""))) & "" />
  <cfset WA_columnTypesStr = "none,none,NULL|',none,NULL" />
  <cfset WA_comparisonStr = " = | = " />
  <cfset WA_fieldNames = WA_ListToArray(WA_fieldNamesStr,"|") />
  <cfset WA_fieldValues = WA_ListToArray(WA_fieldValuesStr,"|") />
  <cfset WA_columns = WA_ListToArray(WA_columnTypesStr,"|") />
  <cfset WA_comparisions = WA_ListtoArray(WA_comparisonStr, "|") />
  <cfset insertParamsObj = WA_AB_generateInsertParams(WA_fieldNames, WA_columns, WA_fieldValues, -1) />.........
0
Panos
Asked:
Panos
  • 2
1 Solution
 
Barry CunneyCommented:
Hi panosms,
What is the problem and what is your question?
Are you having problems inserting the date from the Form - Please give us some more details
0
 
PanosAuthor Commented:
Hallo BCUNNEY.
The problem is that i cannot get the date Now() in my db using this form.
When i use The INSERT INTO ...... VALUES........ Now() i have no problems but with this generated code from the extension i can't get it.I hope you did understand me now.
0
 
PanosAuthor Commented:
Hallo again.
I have fixed the code.The working code is
<cfif (isDefined("Form.Insert.x")) >
  <cfset WA_connection = "carfree24" />
  <cfset WA_insTable = "dbo.t_artikel" />
  <cfset WA_sessionName = "WADA_Insert_dbot_artikel" />
  <cfset WA_redirectURL = "t_artikel_Detail.cfm" />
  <cfset WA_keepQueryString = false>
  <cfset WA_indexField = "art_id" />
  <cfset WA_fieldNamesStr = "hersteller_pkw_id|Datein" />
  <cfset WA_fieldValuesStr = "" & ToString(IIf(isDefined("Form.hersteller_pkw_id"),"Form.hersteller_pkw_id",DE(""))) & "" & "|" & "" & ToString(DateFormat(Now() ,"dd/mm/yyyy")) & "" />
  <cfset WA_columnTypesStr = "none,none,NULL|',none,NULL" />
  <cfset WA_comparisonStr = " = | = " />
  <cfset WA_fieldNames = WA_ListToArray(WA_fieldNamesStr,"|") />
  <cfset WA_fieldValues = WA_ListToArray(WA_fieldValuesStr,"|") />
  <cfset WA_columns = WA_ListToArray(WA_columnTypesStr,"|") />
  <cfset WA_comparisions = WA_ListtoArray(WA_comparisonStr, "|") />
  <cfset insertParamsObj = WA_AB_generateInsertParams(WA_fieldNames, WA_columns, WA_fieldValues, -1) />

Thank You.
0
 
Vee_ModCommented:
Closed, 125 points refunded.
Vee_Mod
Community Support Moderator
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now