Setting Result Of Sql Statement Equal To A Variable For Further Use

I'm trying to calculate the total time using values from database I run a select statement to find the timein column in my database.

Now how do i assign the result to a variable so that it can be used? There is only going to be one result because i'm checking it against an autonumber field. that is used as time 1. Code:

View Replies


ADVERTISEMENT

SQL: Less Than Equal To Statement

I am having trouble with this SQL statement:

SQLString = "SELECT * FROM WebVacanciesUpload WHERE (Category='"& Cat &"') AND SalaryForWeb = < 13000 ORDER BY SalaryForWeb ASC"

It produces this error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression '(Category='IT') AND SalaryForWeb = < 13000'.

/temp/outsearch2.asp, line 86

View Replies View Related

Variable To Equal Name Plus Number

im trying to set a variable to = a name plus anumber next to it for incriminents soo

name = response.write "vac" & + inc 1 or something im not sure

vac1
vac2
vac3
vac4

and so on

View Replies View Related

Check Box Equal To A Variable (moved From Html)

I Have a form, and in that form I have a check box, I wish to say " If Checkbox is checked Then variable = true Else Variable = false". Here is what I have as far as code goes...

Thus far the variable is always false, leading me to believe that my syntax is wrong. All the SQL part of this is tested as working (Included to give a perspective on what I am trying to do) so you can for the most part ignore it. It is the form part that has a problem. Code:

View Replies View Related

Combine The Two Variable Values And Show The Result

I have two variables:

UserLastName = request.cookies("UserLastName")
UserFirstName = request.cookies("UserFirstName")

and I'm trying to create a third variable that would strip the first letter of each of the above variables and combine them to create initials. Eg. if FirstName is John and LastName is Doe, the UserInitial variable would be "JD".

View Replies View Related

Variable Equal To The "size"

I have an SQL database that tracks workorders for my company. Each workorder is ID'ed by a number, i.e.: 1234. The next would be 1235, 1236, etc. I need a loop to go through EVERY workorder in the database.

How do I set a variable = to the largest WorkorderID in the database? i.e.: That would be 1500 if there were 1500 workorders in the database. Don't worry, there are other checks in place so that it won't always loop through every single workorder (I thought about that already).

View Replies View Related

Setting Variable In Query

I have a sql query that runs on my asp page.

select
contactname,contactnumber,contactnumber1,contactem ail,address,city,state
,zip,type,sqft,0,bedrooms,baths,lotsize,acreage,ga rage,comments,price,0,
0,county from table1 where active='Y'

I need HASPHOTO to equal 1 if hasphoto <> 0 and HASPHOTO=0 when
hasphoto=0. Make sense? HASPHOTO usually equals a number, but in this
case, I want it to equal a 1 or 0 because I am exporting this to a CSV
file. I know how to do everything else, just not this part.

View Replies View Related

Setting A Server Variable

I know that you can do : Request.ServerVariables("QUERY_STRING") but can
you actually set a serverVariable?
I know that sounds counter intuitive , but is it possible, via vbscipt/asp?

View Replies View Related

ASP Equivalent Of CFParam - Setting A Value Of A Form Variable

I'd like to do something similar to CFParam, but in ASP - basically, I have a form variable ("Type") which may or may not be passed from the referring page. Some referring pages have an input field called "Type", whilst others do not.

I'm actually a CF developer, but keen to learn ASP. My current code at the top of the script is : Code:

View Replies View Related

Setting Session Variable Maxes Dllhost

I have an ASP application that has been running for 5 years that I am now modifying. Since then, I have installed asp.net 1.1 and 2.0 on my xp pro box. Whenever I run the "login" code for the app, it crashes as my dllhost goes to 98% cpu. I have traced the code to this line:

Session("SCHUserID")=123

What is strange is if I set the value to 11 or lower, this does not fail. What is also strange is if I set Session("SCH1UserID")= 123 it works. I know this has to have something to do with running asp.net on this box as well. I have tried running the app in its own process (High) and creating it's own virtual directory with no luck.

View Replies View Related

Filter The Result And Display The Final Result

it is possible to compare the result of 2 recordset and
filter those similiar results,and display only the remaining results

View Replies View Related

Variable In SQL Statement

I need to add the following variable into an SQL statement and not sure how to do it. strGCID needs to be inserted into the following statement:

SQL = "SELECT tblContacts.* FROM tblContacts INNER JOIN tblGC ON
tblContacts.GCID = tblGC.gcID WHERE (((tblContacts.GCID)=strGCID))"

i am just not sure of the proper syntax.

View Replies View Related

How Do I Put A Variable And A Non Variable In A From Statement?

sql = "SELECT * FROM & console &'news'"

I got that right now but i want the variable, console to be placed along with news so when it selects from the db it selects from gcnnews or whatever variable it's on. How do I do that?

View Replies View Related

How To Get Variable = To Loop Statement

I need this variable = to a loop statement

Here is my str

form_bcc = Cstr(If Not objRS.EOF Then objRS.MoveFirst Do While Not objRS.EOF objRS.Fields("Email") Response.Write ";" objRS.MoveNext Loop End If)

And help on how to get this to work?

View Replies View Related

Pass Variable To Sql Statement

I have created a hyperlink in one page (all.asp) using this code:

<a href="cat.asp"><%= rsProds("category")%></a>

How do I create the sql statement in cat.asp to show only the categories listed by the link in all.asp?

I have this in cat.asp so far:

strQuery = "SELECT * FROM biz WHERE category = ' " & strVariable & " ' ORDER BY bizname ASC"

which shows nothing since the string variable had not been passed.

How do I get the hyperlink category name into cat.asp sql query as a variable?

View Replies View Related

If Statement Comparing Variable

I'm trying to use a variable of retrieved via request from a form to select records.I'm pretty sure I am having a basic syntax error or something else basic. I retrieve the variable from a prevous form:

section_id = request("section_id")

I then retrieve some records and run the compare, if i use the actual value it works:
if rsArticles("tbl_articles.section_id") = "1" then

however if I substitute the variable section_id which equals 1 , it fails the compare and moves on to the else:

if rsArticles("tbl_articles.section_id") = section_id then

if I call the section_id value elsewhere it shows that it is set to 1, so I know it's being passed, <%=section_id%> returns 1 . What am I missing?

View Replies View Related

Feed Variable Into Include Statement

i'm trying to change the following include statement :

<div id="contents">
<!-- #include file="includes/main_page.asp" -->
</div>

on an ASP page into something that receives the file name as a variable :

<div id="contents">
<!-- #include file="<%=fileToInclude%>" -->
</div>

however, this doesn't seem to work, as i get the following error message :

The include file '<%=fileToInclude%>' was not found.

it obviously is trying to find a file named <%=fileToInclude%> instead of seeing the variable my question is : is it possible to feed a variable into an include statement ?
if yes, how should i go about it ? if not, are there any alternatives ?

View Replies View Related

Form Passing Variable -SQL Statement - Matching Data Type

I have a page that calls itself using a form. The form has two select elements. In the sql statement I am attempting to match the values of the select element to populate a recordset.

The two fields in teh Access db are of type Text and of type Integer. What baffles me is that one sql statement works fine and the other returns nothing. I am having the issue matching on the bedrooms.

In the first statement I took out all other doo-doo and just matched bedrooms = request("bedrooms"). On the other one I used p.bedrooms but it keeps turning up empty. Code:

View Replies View Related

Does Not Equal

the operator for the following bit in the bold?

[vbs]
If variable1 Does Not Equal variable2 Then
'Do something
End If
[/vbs]

View Replies View Related

Two Variables With Same Value Not Equal?

I've got two variables:
currentPage = the current page number being viewed
nPages = the total number of pages

After navigating my site to the last page, these two numbers are the same, yet when I compare them with

if currentPage=nPages then
(execute true statement) else (execute false statement)
end if

the true statement never happens. I have printed the values of each variable just prior to the conditional and verified that they are the same. The only thing I can think of is maybe they are somehow different variable types or one has a decimal value I'm not seeing. Any ideas?

View Replies View Related

Equal Width Of Button

I m using front page.I have used some button and value of all button is different so its width show different.I want to equal width of all buttons.I dont want to use link button.

View Replies View Related

Text Field Equal To Entered Value

I need to make a text field equal to the entered value. Example: First time to the page nothing will show up in the field because nothing was entered. I enter a value and submit the form. The redirect is to the same page to add new inforation but this time the value entered in that one text field will be there. I tried <%=Request.Form("box")%as the value of the text field but to
no success.

View Replies View Related

Problem In Equal Width Of Button

I m using front page. I have used some button and value of all
button is different so its width show different. I want to equal width
of all buttons. I dont want to use link button.

View Replies View Related

Equal Width Of Button In Front Page

I m using front page. I have used some button and value of all button is different so its width show different. I want to equal width of all buttons. I dont want to use link button.

View Replies View Related

Problem In Equal Width Of Button In Front Page

I m using front page. I have used some button and value of all button is different so its width show different. I want to equal width of all buttons. I dont want to use link button.

View Replies View Related

Sum Result

I have a database setup and the results come out as

Product 1: Shorts
Size: M
Price: £2.99

Product 2: T-Shirt
Size: XL
Price: £3.99

Total: "TOTAL HERE"

What I need to do is total these up

The Cells are called:
Product
Size
Price

View Replies View Related

Result Set

I want to do some checking for my table for eg:

I want to check if the table for which year then if same year then do something.....

View Replies View Related

Calculation Result

Does anyone know how i can make

[code]
Dim excl

excl = rs("price") / 1.175
[code]

return only a 2 decimal place number

View Replies View Related

Top 10 Search Result

i want to have a search application wherein it returns a results page and arranged based on the most relevant word. can you please give me an idea with this or point me to any info.

View Replies View Related

Assigning The Result

How can I assign the result of a SQL-query to an ASP variable? This is what I have so far but it doesn't seem to work. Code:

dim strSQL
strSQL="select TestID FROM TestID_Description WHERE CL1='" &Request.Form("CL1")& "' AND CL2='" &Request.Form("CL2")& "'AND CL3='" &Request.Form("CL3")& "'AND CL4='" &Request.Form("CL4")& "'AND CL5='" &Request.Form("CL5")& "'AND CL6='" &Request.Form("CL6")& "'"
objRS("TC_Number")=objConn.execute(strSQL)

Maybe it's interesting to know that TC_Number is the primary key of the table.

View Replies View Related

Detect Result

The delete method of the FileSystemObject.FileObject does not return a result. If permissions disallow deletion, it will not raise an error. Conversely, if the delete method does succeed, a call to FileExists directly afterward may return true because the system hasn't updated yet (or whatever actually goes on). Is there any way to accurately check the result of a deletion?

View Replies View Related

ASP Result Page

why my results page is not coming back with anything?? I have set up a simple form in dreamweaver, it connects to a access database and IIS web server. When i test the recordset it works ok (returning the desired affect).

It uses a post method therefore the recordset uses form variable. But when i preview in browser(either IE or Firefox or Netscape) and enter text the browser comes back with something like the page does not exist or can't be found? It's not the recordset and result page so is there something else i'm missing?

View Replies View Related

Joining 2 Result Sets

i want to left join result sets together coming from two different databases based on a common field storenumber. They are separate databases as per management design.

Basically it should match rows based on the store number, those who don't have matches should display only the storenumber and no other info like: Code:

Store Q1 Q2 Q3 Q4
1 x x x x
2 x x x x
3 <--No data in 3, just display storenumber
4 x x x x

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved