Problem With Inserting Date Value Into MSSQL
I'm trying to insert a date value into MSSQL, the type of the sql filed
is: "smalldatetime" and i'm trying to insert a text Variable that looks like this:
"19/02/2006".
.... SET update_date='" & Update_Date & "' ...
i get the message:
The conversion of char data type to smalldatetime data type resulted in
an out-of-range smalldatetime value
View Replies
ADVERTISEMENT
The scenario is that the user enters a description of a special offer into a text box and then can add that record to a database field using the insert method of asp. However, an error occurs if the description has any apostrophes in. For example,
special offer 1: andy's prize plums
could cause an error because the insert looks something like this
"insert into offersTable(offerDescription) values (' " & request.form("description") & "'"
is there some way to escape all naughty characters so they don't cause a problem. Any suggestions very welcome.
View Replies
View Related
How can I do a query like below on a MSSQL server? The format of the date in the db is 10/9/2004 8:38:01 PM
onlinedate = now()
strTimeout = 5
StrOnlineTimedout = dateadd("n",-strtimeout*3,onlinedate)
StrSql = "DELETE FROM active_users WHERE Last_Seen < " & StrOnlineTimedout &""
View Replies
View Related
I’m new to MSSQL and I’m having a problem with an ASP3 JS website that I’m upgrading from Access. I’m trying to format the date from mm/dd/yyyy as held in the db by GETDATE to display as dd/mm/yyyy on a web page. Previously with the Access db I used:
"SELECT format(addate, 'dd/mm/yyyy') as addate1 FROM...”
What do you use with MS-SQL?
View Replies
View Related
I have a form that I submit to an oracle database. Along with the info from the form I want to insert the date it was submitted. How should I go about doing this? I am having problems because it is the wrong format?
I am using a 'date' data type for the field. How can I convert the date into the correct format that will allow me to submit it, I have tried using to_char or to_date, but they give me an error?I tried using this to convert it, but it doesn't work, I am getting a syntax error?submit_date=to_date(date,'YYYY-MM-DD')
View Replies
View Related
i m reading data from a excel file and inserting its fields into access database, everything is fine but i m getting problem when i m insertin the data string into the date/time field of the aceess database,i have use the CDate function but it is not working.what should i do?
View Replies
View Related
I am trying to insert a date into a date field through my website. The date
is pre-populated with todays date. I am getting a type mismatch error. The
Access DB is setup as a Date/Time Short Date field. Code:
View Replies
View Related
i need to insert the date only into date/time field in sql server 2000. i tried this
Code:
newsdate=date()
insql= "insert into news(news_date) values( "&newsdate&" )"
ADO.execute(insql)
but it always insert the date 01/01/1900. i searched the net and found this.
Code:
newsdate=date()
theloc = SetLocale(ado.Properties("locale identifier" ))
insql= "insert into news(news_date) values( "&newsdate&" )"
ADO.execute(insql)
SetLocale(theloc)
View Replies
View Related
i found a different way to insert the date or rather not insert the date at all if a certain condition is true. But anyway i have come accross the same problem when i try to update the date field with a blank value. Code:
View Replies
View Related
i have a field which accepts the date as dd/mm/yyyy but when i insert the value it becomes mm/dd/yyyy for some date values like 9 april become 4 august.... the database date format is mm/dd/yyyy and i just take the value out and display it as dd/mm/yyyy.. however ...
my update and inserts can't use the same function, cos the function is just display out the server's date as dd/mm/yyyy... how should i add i in correctly?
here's my insert and update function[img]images/smilies/bawling.gif[/img]
PHP Code:
Dim ddate, ydate, mdateFunction FormatDateDM2MD(sdate) if sdate="" or sdate=" " thenFormatDateDM2MD = "NULL"elseddate=day(sdate)mdate=month(sdate)ydate=year(sdate)sdate= ydate & "/" & mdate & "/" & ddateFormatDateDM2MD = "'"&sdate&"'"end ifEnd Function
i have another problem my date values when its 10 of Nov it comes out as 11/10/2003 instead of 10/11/2003 why? how do i solve it? Code:
View Replies
View Related
i have a field which accepts the date as dd/mm/yyyy but when i insert the value it becomes mm/dd/yyyy for some date values like 9 april become 4 august.... the database date format is mm/dd/yyyy and i just take the value out and display it as dd/mm/yyyy..
however ... my update and inserts can't use the same function, cos the function is just display out the server's date as dd/mm/yyyy... how should i add i in correctly? Code:
View Replies
View Related
I am trying to insert the date into a *.csv file using the following line
csvBody = csvBody & "" & fix(FormatDateTime(now(), vblongdate) & ""
The fix function is as follows
function fix(strInput)
strInput = replace(strInput, """", "")
strInput = replace(strInput, vbNewLine, " ")
fix = strInput
end function
I would like the Date to appear as Wednesday 16th June 2005 within a single cell (without commas).
View Replies
View Related
this is the code im trying to use to insert a date to mysql db:
dim myquery
dim datew
datew = formatdatetime(date())
myquery = "INSERT INTO article (date) VALUES ('" & datew & "')"
this inserts a date but its always "0000-00-00", i want to get the actual date and add it to the table.
View Replies
View Related
I'm trying to take a date from a form and insert it into an Access 2000 database with ASP
Here's the code:
frmClubId = Request.Form("Names")
frmDate = Request.Form("Date")
sqlStatement = "INSERT INTO testDates(ClubId,Date) VALUES(" & frmClubId & ", #" & frmDate & "#)"
Set rs = conn.Execute(sqlStatement)
I've already Response.Write the sql, so I know that frmClubId is and integer and frmDate is mm/dd/yyyy.
View Replies
View Related
I have imported a list of links to MSSQL database with enterprise manager. I use ASP to show the list of links and it's description. Originally I had 8600 links in the database and I have imported 700 new one.
I have checked in table and all the links exist and the table is indexed on field linkID. My asp script has worked before and there is no problem with it.
I can still show all the links including the new links and it's descriptions but if I click on an old link, it goes to that site while with new imports, it just opens another example of my site (404 page set to open my index page).
The link is correct since if I copy it from screen and paste in browser, it opens the page correctly.I have removed the index from table and made it again but no difference. There is also an edit function in my script, if I click on it, I will get a message that filed linkID does not exits but it clearly exists in the table and the rest of script is using it.
View Replies
View Related
If I creat a ASP page, what do I need or how do I connect to a MSSQL database? Is it possible to connect to MySQL with an ASP page, or is it better to stick with MSSQL when creating an ASP page?
View Replies
View Related
Does anyone try before using ASP to execute JOB in MSSQL?
View Replies
View Related
I was wondering if anyone could give me some pointers as to using ASP (Javascript, not VB) to get XML out of SQL.
I have my storedProc with the FOR XML AUTO on the end, and that is returning a recordset with XML fine in query analyzer.
I am lost as to how to output this as XML from an ASP page so I can transform it with XSL.
My transform would be something like: Code:
View Replies
View Related
Looking for suggestions on any stable asp/MS SQL server content management systems in the market place. Any suggestions, or even places where I can look? I have quickly seen Rainbow and would like any comments from users of this CMS.
View Replies
View Related
I am currently learning ASP but have a small PHP background,
With PHP I used PHPMYADMIN to work with MYSQL
Is there a web based Alternative for
ASP and MSSQL that provides similair functionality?
View Replies
View Related
I have a query to one table but one of the values in the table is referencing a record from another table... here is the sql Code:
strSql = "SELECT streetdate, barcode, itemname, descrip, vendor, sku, catlog, config, retail_cost, cost FROM blah WHERE (STREETDATE >='"& GSTARTDATE &"') AND (STREETDATE <='"& GENDDATE &"') ORDER BY STREETDATE, CATLOG DESC"
now I have 2 things going on here...
1. vendor is just a number... there is a tblvendor that matches the number with a name (that i need.. i coudl nest another db query but figured that would be more resource intensive as this returns 1000s of records)
2. itemname is also a number that references another tblItem the sam way, I woul dlike to sort alphabetical off this somehow (is it even possable)
View Replies
View Related
Can't seem to find anything relating so forgive me if i've missed it.
I'm after a way to open either a csv or xml file, then cycle through each line to see if it's in mssql, if it is update it... otherwise add it and then if it's in mssql and not the csv, remove it.Is it possable?
Still learning and haven't dug into opening files, let alone this so any help would be grateful... oh and the fields are exactly the same in both
View Replies
View Related
Anyone know of a free advanced mssql hit counter?
View Replies
View Related
In our office we use RMS (Residential Management System) and they use an MSSQL database to store all the data. we can access this database using access and have made several...several queries to pull out info, save it to another access database, then upload it to the web and pull data from it.
the server that houses the MSSQL database is online and i was wondering if it is possible to connect to it and pull out information. we wouldnt want to change anything, just view.
so to connect to it, what all do i need to do?
View Replies
View Related
I'm just deciding whether to use Access or MS-SQL for a web-application
I'm predicting that my application will grow large enough to warrant use of MS-SQL, but I'm wondering how extensive the changes to my code that would make
...Specificially in ASP.Net, if I use ADO.Net, would I just need to modify my connection string or would it involve more extensive modifications?
View Replies
View Related
I am new to programming and I managed to store images in MSSQL.
The problem I have is that when I retrieve the image from the database
and display it in my browser it opens a new window. I would like to use
the image control, but it requires a url. Is there anyway of viewing that image
in the image control or keeping it in the same page where my information is
but displaying it where and when I want it
View Replies
View Related
I want an answer by tomorrow with examples and reference URLS if we can do this.There is a program written in ASP and the databse is MSSQL (Microsoft) hosted in Windows platform.
But they want this databse and ASP Program host on a UNLIX/LINUX server and use the same ASP program. Can thy do it/ and how?
View Replies
View Related
I had used ASP about a year ago, I had connected to a *.MDB database but not MSSQL,can someone please throw me the just of it
View Replies
View Related
I am using a Windows 2000 Server and when i tried creating a simple asp application this error always appear everytime I access the database. Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'MYSERVERIUSR_MYSERVER'.
/o/faculty_evaluation/add_dean_db.asp, line 22
what kind of error is this?
is there something wrong with my connection string -> conn.Open "Provider=sqloledb;Data Source=MYSERVER;Initial Catalog=dog_evaluation;Integrated Security=SSPI;"
View Replies
View Related
any one have the connection string and included query on how to connect to the mssql server?
View Replies
View Related
If I create an ASP page, what do I need or how do I connect to a MSSQL database. And, is it possible to connect to a MySQL with ASP, or is it better to use MSSQL when developing a ASP page?
View Replies
View Related
I am planning to convert an ASP/MS SQL based site into ASP/MySQL to save on monthly recurring fees. MSSQL costs additional $40 a month while MySQL is free. Are there any major technical issues?
View Replies
View Related
If you have a large traffic site, say over 30 current users accessing the database at once, can Access handle this. I know MSSQL can. Is there any other databases that can be used with asp other than Access and MSSQL and what would there benifits be?
View Replies
View Related