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
ADVERTISEMENT
I'm working with an Access DB, and two tables. This is going to be ported to MS SQL shortly. The tables are category and merchantcategory, and the link is on category.id and merchantcategory.category_id.
*** Category Table ***
id, category
1, apples
2, oranges
3, lemons
*** Merchantcategory Table ***
id, category_id, merchant_id
1, 1, 1
2, 3, 4
3, 3, 19
What I need to do is something like
SELECT category, count(merchant_id) AS merchants
FROM category, merchantcategory
WHERE category.id = merchantcategory.category_id
GROUP BY category
ORDER BY category
But, I need the merchants column to either return 0 or NULL for those categories that do not have an associated merchant. I would like to see something like:
1, 1
2, 0
3, 2
A. Is this possible?
B. If it is, what do I need to do to get the result? I would prefer not to have a bunch of record sets and loops.
View Replies
View Related
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
View Related
I have a problem with show all values from my database into my html page! Code:
View Replies
View Related
I have a form where the user selects their EmployeeID from a DB populated dropdown list. Then they fill out some other information and submit the form. I would like to make it possible that when the user selects their EID, other DB information tied to that EID is displayed on that page (Name, Phone #, etc), so that when the EID is selected, the employee can see their name and info, before the form is submitted.
Is it possible for JS/DHTML to show which value is selected (without posting the form) and then use that variable to call the additional information from my DB using SQL? I would probably then show that value using <div> or something.
Sorry, I am familiar with ASP/VBScript & SQL, but I don't know a ton about Javascript. And I don't think what I want to do is possible with only ASP, unless I post my form to another page, and then that page post the final submission for the form... I'd rather keep everything on one page, then submit the form.
View Replies
View Related
I have one table which has 3 fields within a SQL Database, the first is ID numbers, the second is Country and the third is City (within that Country)Eg: I have 1; United Kingdom; London
What I am trying to do is have an “optgroup” dropdown box with the Countries as the optGroup label and the cities related to each country under that optGroup. I want to populate the dropdown box with this data, preferably in alphabetical order of city. Is there a way to do this in ASP?
View Replies
View Related
I have a textarea that displays the values from the recordset. But how can I display each value in a seperate line
While not rsHires.EOF
Response.Write rsHires("Emp_Name") & "
"
rsHires.MoveNext
wend
I tried <br> too, but they get printed into the textarea.
View Replies
View Related
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
I am trying to compare the value of a number in a session variable to a value of a number in a querystring. The code works well until I reach double digits in the querystring. example. if my session variable = 7 and the value in the querystring = 64 and I ask which one is > (greater than) the other, the code returns the session variable (7) as being greater? I realize that only the 6 & 7 are being compared but how do I get it to view the querystring as 64 and not just 6??? The code looks like this...
if session("page") >= Request.QueryString("RC") then
session("page") = 1
else
session("page") = session("page") + 1
end if ..
View Replies
View Related
I have a page with 10 buttons. I want to control the content of two variables (say vari1 and vari2) based on which button a user clicks. So if I click button1, vari1="1" and vari2="2"; If I click button2, vari1="3" and vari2="4", etc.
The variable contents are actually going to be text strings, not numeric values, I was just trying to keep the example simple. I've only ever used buttons to submit, reset, or call a javascript, so I'm just not familiar with how I would do this.
View Replies
View Related
I'm using a database table to create forms on our intranet. If the record is 'text', an input is printed, if it's 'dropdown', a dropdown is printed etc. In the case of dropdowns, the next field in the recordset is 'options' (eg Mr, Mrs etc.) and this works fine by splitting the options array and creating a separate <option> for each one.
My problem is that I've written a subroutine that creates dynamic dropdowns and it looks like this: Code:
View Replies
View Related
I have a form that on clicking of the Update button first updates
the specific record in the db, then Inserts if the vMemo field is not
empty. The problem that I'm having is that After updating if you hit
the [F5] key (refresh) it inserts another record ...
I have tried:
1. Clearing the vMemo field after the insert is done (vMemo = "")
2. Setting the value on the form for this field to ""
Neither of these are working. It's not displaying it on the screen
but it is holding it in memory (I guess). Any way to clear this out
after update/insert?
View Replies
View Related
if i have a vbscript function on a certain form and I assigned some values on an array variable on that function, is there a way for me to retrieve the values of that array on another asp page once i submitted the form?
View Replies
View Related
I am trying to display a random background image for a webpage. I found this code to do it
<%
'Defines the number of background images you have
Const NUMBER_OF_IMAGES = 2
'Initiates the randomize function
Randomize
'Sets a variable: this will be used to hold the
'random generated value
Dim intImageNumber
'This is where we create the random number
intImageNumber = Int((NUMBER_OF_IMAGES * Rnd) + 1)
%>
Modify the body tag to accept the random number. In this case we are going
to place it within the image so as to facilitate the selection of a random
image. Code:
View Replies
View Related
Right now i have multiple record sets. Im using the following Select statements:
How can I combine ClaimNbrSQL, ClaimCovSQL, and ClaimantSQL to pull data based on ClaimdraftSQL.
They have different Where_parts because one field is not accounted for in the innerjoins for the the last 3 selects. Anyone know of a better way of doing this? The problem is the queried table is not matched up correctly. For example if there are 2 rows where dft_mirco_ecd_nbr are blank, the ClamiantSQL is off by 2 rows. Code:
View Replies
View Related
I want to let users select one or more of my 5 choices in checkbox format, but also want to have a choice that is "all 5 choices". When "all 5 choices" is selected, I want to make sure they can't check any of the 5 choices. Is this possible?
View Replies
View Related
What I try to do is to combine 2 fields in one directly in a form before the 'submit' button. I use Access and Dreamweaver MX ( ASP VBscript).
In the form, the fields to combine are 'Course' and 'Schedule' to one field 'Course+Schedule'.
I know that we can combine fields in Access. But I need to combine them before to submit the form.
View Replies
View Related
May I know how to combine the text that get from textfield with the "strings" and insert it into database? Can anyone help me to check whether example below is correct or not. Any syntax error?
userid= request.form("userid")
emailaddress=userid + "@xxx.com"
insertsql= "insert into database(email) VALUES( '"&emailaddress&"')"
View Replies
View Related
I have this code that will combine month day and year for some reason it puts the data in the database as January9,2005 February, 22,2005 . I need a space after the first month and I cannt figure out where the c
DateCovered1 = request.form("DatesCoveredMonth1") & " " & request.form("DatesCoveredDay1") & "," & request.form("DatesCoveredYear1")
DateCovered2 = request.form("DatesCoveredMonth2") & " " & request.form("DatesCoveredDay2") & "," & request.form("DatesCoveredYear2")
View Replies
View Related
I'd like to combine if possible these two statements drawing from a total of 3 tables.
sql = "SELECT p.Sub_ID, p.Cat_ID, p.Sub_Name, COUNT(c.Sub_ID) as ct FROM
Subs p LEFT JOIN Links c ON p.Sub_Id = c.Sub_Id GROUP BY p.Sub_ID, p.Cat_ID,
p.Sub_Name ORDER BY p.Sub_Name"
sql = "select * from Subs inner join Cats on Cats.Cat_ID=Subs.Cat_ID ORDER
BY Sub_Name"
Is it possible? Am I totaly screwed up for even trying? The goal is to count the relations ships in the Subs and Links table based on Sub_ID, to display needed data from the Subs table, and to display the Cat_name table from the Cats table in relationship to the Cat_ID in both the Cats and Subs Table.
View Replies
View Related
I want to take the contents of many fields of various datatypes (varchars
and text) and combine them into a single "junk" field that I will perform
SQL Server free text searching upon, e.g.:
tblArticles
Title
Subtitle
ArticleText
CombinedField [Title, Subtitle, and Article text smashed together]
Is it possible to create a query or T-SQL stored proc that would do this? Is
SQL Server DTS a better approach? It needs to be built for each row in the
table, and it needs to happen regularly.
View Replies
View Related
Is it possible to recall a variable with the combination of text + rs.field? i want to recall the variable "speler1", at the place weher rs("speler") is 1. It's probably again easy.
View Replies
View Related
I have 2 store procedure, I need to pass both into the asp page, and combine the result set of two. What is the syntax or the approach to do this.
View Replies
View Related
i have two numbers that i need to combine and then depending on the result i need to write different instructions to the browser. Code:
View Replies
View Related
I have several (three) CSV files each with different columns and dissimilar data. The only common column is transaction date. What I'd like to do is combine the data chronologically. I can't do a join query because the transaction dates do not line up from file to file and no other columns will match either.
I just want all the rows from the three different files put in chronological order in one place understanding that my columns wont line up since the source columns are different. I've exhausted every effort on the SQL side to combine these, but I'm thinking maybe there's a way to do it with FSO or something else.
View Replies
View Related
I have used thecode which is below to get x characters on to display
<%= LEFT(rsName.Fields.Item("columnname").Value,50)%>
It works fine but when I use this same code to get x characters plus display it using VBCRLF, with the <br> with writing the code :
<%=Replace LEFT
(Recordset1.Fields.Item("Detail").Value,VbCrLf,"<br><br>",50)%>
it gives me error so please can you tell me how can i trim the characaters and at the same time use VBCRLF. why does this above code with LEFT + vbCrLF doesn't work.
View Replies
View Related
I have several text files on my server and I would like to combine them into one text file by just appending each file to the end of the combo file. I know this should be possible, I just don't know how to approach it. Some combination of OpenTextFile and CreateTextFile?
View Replies
View Related
I am using asp to submit a form I've created in asp. I was wondering if there was a way to output the vlaues of three listbox menus.
1. User selects hour
2. user selects minute
3. user selects am/pm
This is now outputting into my strBody as seperate entries. I'd like to combine them into one entry within the strBody.
Please reference strStartTime, I've tried to incorporate this into the email strBody, but am unable to accomplish this. Any help would be appreciated. Thanks Everyone!!!
Here is the asp code for the form: ......
View Replies
View Related
I've got a site managed in Frontpage and a forum in phpBB/MySQL. I'd like to grab the most recent posts from the Announcements Forum and embed them in the site's homepage. I got the idea from http://pocketpcthoughts.com/ . All of their homepage posts are fed from their FrontPage Archive Forums.
Right now, I'm using a phpBB mod called FetchAll to do the job. It works great except for one thing: I have to do it via an inline frame because I can't include a PHP file in an ASP page, and I have to use ASP because the site is in Frontpage (project requirement; FP is essential to the non-forum part of the site). Code:
View Replies
View Related
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
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
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
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