Group By Statment Problem
i want to display the number of people logged on at each location... when someone logges in they get a type=1... that works great but when i try to group by the NasName thats the location name.. Code:
View Repliesi want to display the number of people logged on at each location... when someone logges in they get a type=1... that works great but when i try to group by the NasName thats the location name.. Code:
View Repliesi need help with this simple IF then statment.
i want to do this
Code:
IF
response.write objrs ("ok2show") = y
THEN
<img src="http://auditors.demosales.netauditimages<%Response.Write objRS("cnum") %>.bmp" alt="Demonstrator" width="800" height="600"border="7" >
ELSE
<img src="http://auditors.demosales.netauditimagesdefaultimage.jp g"
it's not working it's getting hung up at the response.write objrs part.
I have an sql statment with an in statment for ID . I'm trying to get the CompanyID in ( ) but all i get is just the word companyID with no value . i used response.write request.form("companyID") so i know the value is coming to the other page, this is what i have now.
Response.Write ("& CompanyID & ")
and this is what i see
& CompanyID &
how do i get the value of companyID in ().
what is missing fromt his sql statment its for an asp page that displays a list of results?
rs.Open "SELECT * FROM downtime WHERE downtime.Entrydate = #" & mediumdate&"# AND Supervisors_name<>"none"", conn,1
i get a message saying expected end of statment and it worked up until i added the AND Supervisors_name<>"none" in to the statment?
I am trying to pass a variable from another page to a sql statment. The variable specifies the one of the columns that I want the sql query to return. I also want to display field contents of the column later in my page. I can't seem to get this to work. Can someone give me a hand? Here is my code:
View Replies View Relatedi have this variable:
name="Jones, andrew"
when i update the table it gives an error
here is my update code:
str= "UPDATE tblnames SET Name = '" & name & "' WHERE Id ='" & getid & "'"
can someone tell me whats wrong with it because the name variable has a comma in it.
I'm not an hardcore programmer but i try to do a simple search in my asp pages.
I've a database .
I've try this code:
rs.Open "SELECT titre , sstitre , carac , gastro , historique , cepage FROM catalogue WHERE titre , sstitre , carac , gastro , historique , cepage LIKE '"&Request.Form("Sstring")&"'" , conn
But i've that's generate an error in my explorer...
I have a sql statement that pulls up a certain amount of records according to a requirement. Let's say that 20 records show up. I want to get to the 5th one. Well now I know that I can use the move() function to enable that, but it is the same page.
The page executes the sql statement and by default shows the last record in the query. Now when I ask for the 5th record the page is reloaded, the sql statement exectures AGAIN and the 5th record shows up. Is there way to ask for the 5th record without having to re-executing the SQL statement?
Given the following that results from a form which has multiple checkboxes with the same name value, the resulting string when stored into a variable is this - 129,200,323,330 I used the replace function and got this - 129 OR 200 OR 323 OR 330.
I want to somehow use these values (ints) to specify the particular records in an access database and populate a record set.
When I do this, I get nowhere - "Select * From images WHERE id=" & img_ids
Whereas img_ids is the above string...
I've got the following statment in my website:
<%
if session("memberId") = objrs.fields("memberId") then
%>Some Id<%
else
%>Different Id<%
end if
%>
The problem is, if boths are the some number it still displaing Different Id.
Is there anyone can tell me what am I doing wrong?
Now here is my insert statment and it is giving me this error message:
Insert Record
'strSQL2 = "INSERT INTO tblCONTENT_Links (LinkID, ContentOwner_UserGroupID, ContentGrouping, LinkHeaderOrder, LinkDescription, LinkName, LinkURL, LinkHeader, LinkHeaderCategory, LinkRefSite, Active, Archive, UpdatedDate, UpdatedBy, PasswordProtected, CommonLibrary) values ( 141, 7,'public', " & Category & " ,'" & DocumentName & "','" & DocumentTitle & "', '" & Document & "', 0 , 28 , 'www.skyclimber.com', -1 , 0 , #8/27/2004# , 0 , 0, -1)"
IE error:
Syntax error in INSERT INTO statement.
I'm using the following code on my website:
if left(session("lastPage"), 5) <> "admin" then
session("return") = session("lastPage")
else
session("return") = ""
end if
My problem is even the "left(session("lastPage"), 5) is equal to "admin" it still not equal the variable session("return") to "". Can anyone please tell me why or what Im doing wrong?
how i would go about using an if statment against a field in a database.
i.e
if id = "fieldname"
then
do this
else
do this
end if
I am still learning asp and would be very greatful if someone could help me.
What is wrong with this statment:
SQL = "SELECT tblEmployee.*, tblDepts.deptdesc, tblEmployee.Inactive FROM tblEmployee INNER JOIN tblDepts ON tblEmployee.DeptID = tblDepts.deptid WHERE " & request.form("txtSearchIn") & " LIKE '%%" & request.form("txtSearch") & "%%'" & " ORDER BY LastName, FirstName"
I am getting a error:
Syntax error (missing operator) in query expression 'LIKE '%%%%''.
I am hoping that some one can tell me how to add an ORDER BY statement to the following:
<% set rst = createobject("adodb.recordset")
set rst = conn.execute("select RegClassID, StartDateTime, EndDateTime, Description, Location, SpecialNotes from CAL_EVENTS_REG_CLASSES where RegistrationID = "&RegistrationID)
if not rst.eof then %>
The recordset returns fine, execpt I need to be able to order it ASC
im trying to write a sql statment that will insert a variable number of fields into a database the code below is what i want to do but i know this wont work anyone any ideas?
or even if this can be done?
sSQL = "INSERT INTO sometable("&For Each field In Request.Form ; "&Field&"," next ; &")values"('" "&For Each field In Request.Form ; "&Request.Form(Field) &"','" next ; &""')"
I'm using the following code in my website that is not working:
Dim objRS
strSQL = "UPDATE tblasp SET view = " & session("NumberOfViewer") & " WHERE id = " & session("aspId") & " "
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open strSQL, objConn,2,2
Is there someone please could tell me what am I doing wrong?
i was using INSERT INTO statment for insrting data to a mdb database file
eg
but now it is not working
there is an error
"Operation must use an updateable query. "
I need to know how to do this IsNull update statment in ASP:
"UPDATE tblUsers SET username='" & lcUName & "', hash= IIf(IsNull([lcHash]),"",[lcNewHash]), inactive=" & llAct & ", locked=" & llLock & ", isadmin=" & llAdmin & ", attempts=" & lnAttempt & ", lastlogin=" & ldLastLogin & ", onlyreadaccess=" & llOnlyRead & " WHERE UserID = " & lnSetID
i have a qs variable that has a & and i need to query the db, what do i replace the & with to query my data correctly?
View Replies View RelatedContentID is primary_key ID and it is automaticlly created upon this insert, but want to also insert that content id in table Category column ContentId. Code:
View Replies View RelatedI'm getting this useful error '80040e14' when trying to run a select statement in an ASP page. The connection to SQL Server 2000 is ok. The variables in the Select statement, 'area' or 'areaid' are passed through form the previous page ok.The code is below... Any ideas? Is it something obviously dense on my part?? Code:
View Replies View Relatedi have a select case statement that checks for a couple of options e.g.
<%select case aParameters(0)
case 0 %>
.. some code
<%case 2 %>
however i would like to test for a certain condition within the select cases statment. To see if a session variable exists before implementing some code:
When I just - SELECT DISTINCT atblProducts.ID AS ProductID, it selects distinct Product IDs but when I add other columns to the select, it doesn't select the ProductID as DISTINCT.
I've heard to try "GROUP BY..." Code:
I have a asp app that I wish to limit execution access to a universal
security group during beta test...
I've tried restricting permissions using ntfs, the virtual directory
and the net.config file (which I assume will not work as this is not a
vb.net app).
I have several arrays, created by splitting a string of comma delimited values, as follows:
arrOne = split("1,2,2,2,3,6,3,7",",")
arrTwo = split("5,2,1,6,5,5",",")
What I want to be able to do is to group the arrays so that I know how much of each there are. I need to output results in the following format:
Number / HowManyTimesThatNumberOccursInTheArray.
So for example, the above would output:
ArrOne:
1 / 1
2 / 3
3 / 2
6 / 1
7 / 1
ArrTwo:
1 / 1
2 / 1
5 / 3
6 / 1
These can literally just be output as a string if needs be. Is this possible? If so, how do I go about achieving it?
I have a catalogue table and forum table in my database. In the cata table , it has ASP, PHP, JSP 3 record. In the Forum Table, it has ASP intro, ASP Install, PHP intro, PHP install 4 record. I want to group the ASP intro, ASP install in the ASP group and The same with the PHP group.
How can i do ? ( By ASP ) .
( Could you please give the asp source code to get the data from database by group ? When the Cat_ID at the 2 table is equal, they are in the same group)
I try to read out the Administrators Group name from a specific Computer in our Network with the aid of the RID.
View Replies View RelatedI'm trying to execute this sql below:
strsql="select Name,CName from Task where Name like '%" & request.QueryString("PrintName") & "%' and CName Like '%" & request.QueryString("PrintName") & "%' group by name"
but it doesn't work and i get this error:
You tried to execute a query that does not include the specified expression 'CName' as part of an aggregate function.
I want to Group my records by the average of a field...
I tried using 'GROUP BY AVG(Rating)' but that's an illegal use...
Is there another way, besides opening another recordset? I also used:
... AVG(Rating) as AverageRating GROUP BY AverageRating ...
But, same problem...
I have a asp page that I need to check to see if the current logged on user is a member of a specific active directory group. How can I do this? I have tried so many different LDAP code examples and none seem to work.
Do I need to include a administrator username and password in the code? Does any have any samples of code I can try?
I have this problem with table of database MySQL. My table with fields ID, Number and Description: Code:
ID ====== NUMBER ======= DESCRIPTION
1 ====== 9168381650==== CDR VER-CS AP-UPS SANLUCA
2 ====== 9168381659==== CDR VER-CS AP-UPS SANLUCA-9
3 ====== 9168381651==== CDR VER-CS AP-UPS SANLUCA-SQ S.SANLUCA
4 ====== 9168381652==== CDR VER-CS AP-UPS SANLUCA-SQ DIST.GUSPIN
From this table I need to have the total of records data all under the description CDR VER AP-CS-UPS SANLUCA.
Is a hierarchy structure where IDs 2, 3 and 4 belong to the description ID 1. I don't like to see the data individually for each description, but the grouping data for macro-DESCRIPTION. For example:
The total records in table are 4, the query return:
"There are 4 records total for description CDR VER AP-CS-UPS SANLUCA."
I have a asp page that I need to check to see if the current logged on user is a member of a specific active directory group. How can I do this?
I have tried so many different LDAP code examples and none seem to work. Do I need to include a administrator username and password in the code? Does any have any samples of code I can try?