473,394 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

dates sql and aspc....

sql query in code looks like this :-

sql = "INSERT INTO livetracker
(ID,MortgageSourced,PostalPackIssued,PostalPackRet urned,SalesManager,Mortgag
eAdministrator,DateToMortgageAdmin,MortgageAppSubm itted,Lender,LendersRefere
nce,Solicitor,OfferIssued,CompCheckedBy,ToSales,Ca lledBy,MortgageResourced,C
allOutcome,OfferChecked) VALUES ('" + userid.Text.ToString + "' , " & msl +
" , " + pit + " , " + prt + " , '" + smo + "' , '" + ma + "' , " + dtma + "
, " + ms + " , '" + lend + "' , '" + lr + "' , '" + sol + "' , " + off + " ,
'" + comp + "' , " + tsl + " , '" + cc + "' , " + mr + " , '" + outc + "' ,
" + offchk + ");"

which outputs :

INSERT INTO livetracker
(ID,MortgageSourced,PostalPackIssued,PostalPackRet urned,SalesManager,Mortgag
eAdministrator,DateToMortgageAdmin,MortgageAppSubm itted,Lender,LendersRefere
nce,Solicitor,OfferIssued,CompCheckedBy,ToSales,Ca lledBy,MortgageResourced,C
allOutcome,OfferChecked) VALUES ('99' , 03/02/2004 , 03/02/2004 , 03/02/2004
, '' , '48' , 03/02/2004 , 03/02/2004 , '' , '' , '' , , '48' , 03/02/2004
, '48' , 03/02/2004 , '' , 03/02/2004);
but in the sql table all the dates are 01/01/1900 (im working in british
date format)

incidently im unsure as to where the 48s are coming from either!!

thanks

mark
Nov 18 '05 #1
1 1042
Just a couple suggestions:

1 - Parameterize the query. Building SQL strings in this fashion puts
you at a higher risk of injection attacks. It will also provide a
little more type safety. I don't think this will solve your problem
but it might prevent other problems down the road.
Some parameterized query examples are here:
http://msdn.microsoft.com/library/de...taadapters.asp

2 - Give us some more to work with. It's hard to see the exact problem
because I don't know if the variable msl is a date time or a string
or...

Hope this helps,

--
Scott
http://www.OdeToCode.com

On Tue, 3 Feb 2004 08:45:02 -0000, "luna" <lu**@themoon.com> wrote:
sql query in code looks like this :-

sql = "INSERT INTO livetracker
(ID,MortgageSourced,PostalPackIssued,PostalPackRe turned,SalesManager,Mortgag
eAdministrator,DateToMortgageAdmin,MortgageAppSub mitted,Lender,LendersRefere
nce,Solicitor,OfferIssued,CompCheckedBy,ToSales,C alledBy,MortgageResourced,C
allOutcome,OfferChecked) VALUES ('" + userid.Text.ToString + "' , " & msl +
" , " + pit + " , " + prt + " , '" + smo + "' , '" + ma + "' , " + dtma + "
, " + ms + " , '" + lend + "' , '" + lr + "' , '" + sol + "' , " + off + " ,
'" + comp + "' , " + tsl + " , '" + cc + "' , " + mr + " , '" + outc + "' ,
" + offchk + ");"

which outputs :

INSERT INTO livetracker
(ID,MortgageSourced,PostalPackIssued,PostalPackRe turned,SalesManager,Mortgag
eAdministrator,DateToMortgageAdmin,MortgageAppSub mitted,Lender,LendersRefere
nce,Solicitor,OfferIssued,CompCheckedBy,ToSales,C alledBy,MortgageResourced,C
allOutcome,OfferChecked) VALUES ('99' , 03/02/2004 , 03/02/2004 , 03/02/2004
, '' , '48' , 03/02/2004 , 03/02/2004 , '' , '' , '' , , '48' , 03/02/2004
, '48' , 03/02/2004 , '' , 03/02/2004);
but in the sql table all the dates are 01/01/1900 (im working in british
date format)

incidently im unsure as to where the 48s are coming from either!!

thanks

mark


Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Riley | last post by:
The date fields being saved by a VB program were being saved as #2003-11-22#. For reasons unknown to me these dates began to be saved as "11/22/2003" All of these dates were made dates with the...
5
by: PW | last post by:
<rant> Sorry guys, but I just have to whinge. Dates in ASP are a total pain in the butt! I seem to get caught out so many times. I realise its my own fault, but going from the posts in this...
10
by: Colin Steadman | last post by:
I'm a stupid ASP programmer and I dont do Javascript (except for very simple tasks anyway), and I'm in a bit of a predicament. I've used a javascript table sorting script from here: ...
1
by: Don Sealer | last post by:
I have a report that includes 5 different subreports. I'd like to be able to open this report using a date function (Start Date and End Date). I'd like all five subreports to show the data from...
2
by: Rachel Suddeth | last post by:
Is there a way to have the non-selectable dates (those before MinDate and after MaxDate) draw differently so my users can see right away what dates aren't allowed? I'm not seeing it... ...
12
by: Dixie | last post by:
I am trying to calculate the number of workdays between two dates with regards to holidays as well. I have used Arvin Meyer's code on the Access Web, but as I am in Australia and my date format is...
1
by: pitfour.ferguson | last post by:
My dbase has the start date and end date of each visit. How can I ask Access to list the day of the week of the start (easy), end (easy) and, more importantly, the dates of the visit itself - ie...
7
by: evilcowstare via AccessMonster.com | last post by:
Hi, I have searched the forum for answers on this and to be honest as a novice I find it a bit confusing so apologies if it is simple. There are some searches that I want to apply to my database....
2
by: Jim Carlock | last post by:
(1) Does PHP provide any way to handle dates prior to 1980? I know there's problems with Microsoft Windows NT and all Windows NT operating systems will allow a date prior to 1980 to be placed...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.