Turning Date Into An Integer
I am looking at doing a rotating image using the date to count it up. I have found a small bit of script to do it but have to admit Code:
View RepliesI am looking at doing a rotating image using the date to count it up. I have found a small bit of script to do it but have to admit Code:
View RepliesIs there a way to turn off the auto fill.. I have page that a user has to enter their logon and password. I do not want the auto fill to save userid/pswd. Can this be turned off or not displayed while typing?
View Replies View RelatedI am trying to turn a page I have in coldfusion into ASP using VBscript. There are some functions in coldfusion that I can't find comparable functions in vbscript. Code:
View Replies View RelatedI am runnig a Oracle procedure(this inserts records in table)with asp.command object.I dont want to commit the inserts, I want to turn auto-commit off when I execute this procedure.Can this be done in ASP,if so,can some one give me a example.
I have some existing ASP code and a client would like it turned in to a function so they can call it in a way like this:
Response.Write(functionname(blah, foo, y, n, n, n, n))
Can anyone point me at a tutorial for turning some existing code in to a function so I can do something like this?
I've been given an ASP site built, tested and working on IIS 5.1 to be hosted on IIS 6. I've gone through the process of enabling ASP, parent paths, and debugging in the IIS Management console. My first ASP works as expected, however, a link to a second gives me the error:
HTTP 500 - Internal server error
This is not a lot to go on, so my question is can i turn on debugging/error messages to give me more of a starter?
if there is a quick way of converting a string into an actual variable.The reason I ask this is to save me having to type each variable name out when trying to request the values from a form.
View Replies View RelatedI've never been able to get my head round arrays, and despite expensive googling I can't work out how to sort this problem:
I have a simple shopping cart that attaches a stock ID number and a quantity to a session variable. Each item selected is added to the session("cart") as "ID.Quantity" and divided by a comma. Thus the string is "12.7,3.45,8.9" etc.
Can anyone show me how to turn this into a two dimensional array, so I can get the relevant records for each ID from my database and match it to the number requested? Splitting the string by comma and then by full-stop has beaten me.
I'm adding fields to a table with this code:
sql = "ALTER TABLE companies ADD COLUMN fieldname int"
now "int" gives the number as a whole number but what is the syntax for this value to be allowed to involve decimals?
If i need to search the ticketnumber by using long integer, do i need to include the single quote like the example below.
strsql="Update offsitetape set status='Open' where ticketnumber =' "&problemopen&"' "
When I get the value from the textfield, do I need to convert it to integer or just leave it like that:
problemopen=request.form("tapestextfield")
I am trying to send a 'single' data type to a sql server db cell that is formatted for 'decimal' from asp/ado code and it is converting it to an integer. Should I be using some other data type in sql server?
View Replies View Relatedwhen i set the checkScore1 to 100 or higher in the table field, the if else condition became FALSE? But it work for 70 to 99 ??
If checkMaxAttempt = "2" AND checkScore1 >= "70" Then
response.redirect "error.asp"
'last attempt check
ElseIf checkMaxAttempt <= "1" AND checkScore2 >= "70" Then
response.redirect "error.asp"
ElseIf checkMaxAttempt <= "0" Then
response.redirect "error.asp"
Else 'do nothing
End If
Is there a way of converting an integer to a string. so can 200 become "200".........i need to do this cuz i want to append it to another string.
View Replies View RelatedI am trying to reiterate through a for..next..loop using an integer (i). I would like to know when it is either a odd or an even number, insteading of using the simple version below:
if i = 1 or i=3 or i = 5 then
Response.Write "<tr " & strRowOdd & ">" & vbcrlf
else
Response.Write "<tr>" & vbcrlf
end if
Want to format table rows in a different style.
Any ideas?
I have a set of values like name,age,desg,salary,year etc . currently i am getting the values using max(year) and displaying the values year is integer in my sqlserver db
If you go thru my code (see attachment) you would be able to understand.
Now the problem is if a person gets promoted or hike in his salary i have to display two differnt salary on the same year how do i do that. currently i am displaying the values based on the max(year) max(year)-1 etc. i cannot modify the database. i have to do some changes on my coding only. Please view my coding as attachment (3000.txt).
For example
Name Age Desig Salary Year
abc 35 CEO 39000 2004
abc 35 CFO 38000 2003
abc 35 CTO 37000 2002
abc 35 CTO 35000 2001
abc 35 Direcotr30000 2001
How do i display this from the database.
I have a set of values like name,age,desg,salary,year etc
currently i am getting the values using max(year) and displaying the values year is integer in my sqlserver db If you go thru my code (see attachment) you would be able to understand.
Now the problem is if a person gets promoted or hike in his salary i have to display two differnt salary on the same year how do i do that. currently i am displaying the values based on the max(year) max(year)-1 etc. i cannot modify the database. i have to do some changes on my coding only. Code:
we have a recordset return by a stored procedure from MS SQL. basically this recordset is an integer value, but when we are checking is value something strange happens :
if RS(0) = -1 then
...
end
for example RS(0)=46 and anyway our program runs what is inside the if ...end structure..
how can we cast -1 to integer... something like in C++ : (int)(-1).... in order to make sure that -1 in integer.
is any way possible to convert a string, which is a string of a number, to an integer (using VBScript). If not, are there any other solutions to have a number that is a string, and add one to increase that number?
View Replies View RelatedHow can I make a variable to be an int instead of being a String?
I want to get it done in VBScript.
so if I have
id = "32"
how can I tell the browser to read that as a int instead of a string.
I get the EmpID from the form which is a variant. When I do the following, I get an overflow error. Can you suggest of a way I can convert this EmpID to a number?Code:
'Get the EmpID from the form
strEmpID = cInt(Request.Form("empid"))
VBScript is the scripting language I am using.
I am calling a javascript function in my asp. I am passing a recordset value, a 7 digit integer, to this javascript function. However, in the function this value is not coming in correctly. say for example i am passing 0360001, in the function when i pass it to another window, its going as 122881.
I am asuming its because of the size of the default integer data type. If you think thats the reason, how can set a long integer data type to this value, if that can be done in asp.
What is the function in ASP to see if an object / string is an integer?
I want to check the contents of a form, and if it's an integer, i.e a number, do something, else if it's a word do something else, and I'm not sure howto?
I have a form, that has a drop down menu with number of options eb. home, work, mobile etc. However when the choice is added to the database table it appears as a number inside the table, even though the field in the table is set to a text value (it is an MS Access DB) Why is this?
View Replies View RelatedI am trying to test a users input to be an integer. Is there a simple function that i can use. Here is a simplified version of my attempt.
dim numTestNumber
numTestNumber = 6
if isNumeric(numTestNumber) = false then
Response.Write "The input must be numeric"
Response.End
end if
if Cint(numTestNumber) then
Response.Write "The Number is an Integer"
else
Response.Write "The Number is not an integer"
end if
I am trying to update an integer field in an Access database with a null value (ie, make the field empty). It currently has an integer in it. Here's the code I've tried, which normally works for all other updates:
set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = sConnString
rs.Source = "SELECT * FROM tblFixtures WHERE FixtureID = " & strFixtureIDcurrent
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 3
rs.Open()
rs_numRows = 0
rs("ArticleID") = ""
rs("Result") = ""
rs.update
rs.close
set rs = nothing
However I am getting a Type Mismatch error on the rs("ArticleID") = "" line. Where have I gone wrong?
Database: Access 2000
How does one switch a converted currency format back to a plain integer in
Asp. I have tried Cint but this produces an overflow error for the
following:
NewPrice = CInt(Request.Form.Item("NewPrice"))
Microsoft VBScript runtime (0x800A0006)
Overflow: 'Cint'
I have a form with several fields that are updated to a DB as an integer. I am using this code to validate the fields:
iincidentdet = CInt(iincidentdet)
If Err.number <> 0 Then
strErrorMsg = strErrorMsg & "Your entry for integer_field could " & _
"not be converted to an integer! Remember that integers " & _
"need to be from -32,768 to 32,767.<br />" & vbCrLf
Err.Clear
End If
when I use my tab to pass by one of the integer fields which should be a 'zero' or null. Is there a way to default the fields to a null value?
How to do the error handling if the users key in character into integer text field? If possible, please give example and show me the coding.
View Replies View RelatedI am developing a simple booking system where I had a booking date. The problem is I want to make sure that the user must book 3 days in advanced for certain room.
I have tried to use DateDiff but it seems doesn't work. Actually i just 1 to make sure that the user must book 3 days in advanced from the current date. I am wondering whether there is anything goes wrong in my datediff function. Code:
i'm new here and i'd like to ask if there's someone who knows how to compare date() function and date from database with date/time type inside select statement so i don't have to do if..then..else
View Replies View Relatedsql = "UPDATE Marknad SET" _
& " Typ ='" & Typ & "'" _
& ", Modell ='" & Modell & "'" _
& ", Arsmodell ='" & Arsmodell & "'" _
& ", Beskrivning ='" & Beskrivning & "'" _
& ", Stad ='" & Stad & "'" _
& ", Prisidé ='" & Priside & "'" _
& ", Fornamn ='" & Fornamn & "'" _
& ", Efternamn ='" & Efternamn & "'" _
& ", Telefon ='" & Telefon & "'" _
& ", Epost ='" & Epost & "'" _
& ", Datum ='" & Datum & "'" _
& " WHERE (((Marknad.Annonsnr)=" & Request.QueryString("id") & "))"
DatabaseConnection.Execute sql
---
Above does work as I want it to do BUT it inserts 1/8/2006 instead of 8/1/2006 as it should!
The best thing would be to exclude the date from updating at all, but when taking away the line:
& ", Datum ='" & Datum & "'" _
It gives an error... how do I solve this?
I forgot, you might want to see this:
Datum = date
In my page i have two combobox. one for year and one for week numbers.Now my prob is
1.when i select a year from combo box 1, second combox box will display the number of weeks in that year.eg if i select 2005 it display me list from 1 to 53 as there are 53 weeks in 2005.
2.when i select a weeknumber from combobox 2 and press submit button it ll display start date and end date of entered week.
I am trying to compare two dates. My problem is no matter what the value of mydate, it is still fall in the first IF statement condition (even if mydate is 10/10/2004). Any advise for this matter?
mydate = "6/6/"&year(date)
IF date() <= mydate THEN
response.write "first half of the year"
ELSE
response.write "second half of the year"
END IF