Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Insert date in MS SQL

Posted on 2007-12-01
5
1,764 Views
Last Modified: 2010-08-05
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
Comment
Question by:Panos
  • 2
5 Comments
 
LVL 17

Expert Comment

by:Barry Cunney
ID: 20389079
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
 
LVL 2

Author Comment

by:Panos
ID: 20390671
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
 
LVL 2

Accepted Solution

by:
Panos earned 0 total points
ID: 20390737
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
 
LVL 1

Expert Comment

by:Vee_Mod
ID: 20631847
Closed, 125 points refunded.
Vee_Mod
Community Support Moderator
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question