Set RS = Conn.Execute("SELECT TOP 10 id, score, numvotes FROM [user] WHERE active = '1' ORDER BY (score/numvotes) DESC")
Simple query, nothing to fancy. However it doesn't order highest to lowest correctly. Here's a sample output:
Everytime I try to pull a query and order it by the price of something, 1123 comes before 300.
It just makes no sense, all that I can think of is that it is ordering by the first digit of the number. Is there anyway to sort it the right way having 300 come before 1123 when you want to sort it in lowest to highest numbers? Code:
<% Set rsTest = Server.CreateObject("ADODB.Recordset") rsTest.Open " Select * from special WHERE CURDATE() <= dat AND line='me' ORDER BY price asc limit 0,1",conn if NOT rsTest.EOF then do while NOT rsTest.EOF %>
how i can have a number which can be generated gradually instead of randomly. I have a script for order number in my transaction page but it generates in random. we prefer order number generated gradually cos random numbers will be hard to trace should we ever need to retrieve it. okay here is the script Code:
Dim MyNewRandomNum Randomize MyNewRandomNum = Round(Rnd * 100000000000)+1
I am trying to assign an invoice number to orders that are made on my website so that i can combine multiple order numbers into one invoice number. Here is the code i am using to insert the invoice number into the orders table.
It works if there is only one order in the table but if you try and order again it multiplies the orders by the number of invoice rows for example if there was 3 invoice fields it would add the same order 3 times into the order table. Its got stuck in some sort of loop. Code:
I'm uploading a file locally and I'm trying to passing it throug a variable and I'm having a problem with locating the exact file name from the upload_document page. I thought is was "r_title" but for some reason the file name isn't stored there.
I am using ASP to query access db on IIS5 I need to find exact matches for search terms within a string. EG "cat" will find cat but not catastrophe from within a large string. I cannot use "=" as that would match the whole string and I only want to find the exact match within the string. I am trying "like '%[!a-z][search term][!a-z]%'" which is pretty clumsy and also doesn't pick up the search term if it is at the beginning of a sentence. Can anyone help me with the syntax here? I have racked my brains coming up with all sorts of convoluted solutions that all end up having a flaw. I have been looking around ASP fora and it seems a few people are asking the same question but getting no answers. (you might see my question in some of them...) I am sure there must be some operator within sql as there is in FMP but I cannot find it.
regarding EXACT search. i want let user search with ANY or EXACT match. i had done any with
instr(products, '"&st&"') > 0
where products is my database field, from where search result come and st is the search string entered by user. now want to provide EXACT search. e.g. machinery will match only machinery and not machine, machineries, machines etc. i had tried LIKE predicate. is there any other way to provie EXACT match ?
i want to provide exact match. e.g. if user enters pharma machine result only display records containing pharma machine and not records containing either pharma or machine.
database table: company_info
database field: products
user entered search (field name): st
i had tried the following
select * from company_info where products like '"&st&"'
i am doing a database search project. and i would like to know how do i get exact keyword searched from the database. for e.g. if the user enters keyword as "lan" to be searched it should return only records that contain exact keyword "lan" and should not return "plan" and other words like that.
i get "system cannot find the file specified" error. iam sure that the path of file iam looking for is true. i guess this is a friendly message thrown. when i turned off the freind messages in IE (client side) i still get the same error. is there any way that i can see the exact error so that i can debug.
I need to insert some number into database as text. My problem is if I insert the number (ie. 4.0), the value in the database only show (4). So, is it possible to convert a real number into text number using ASP?
in master batch table i have various master batch like 200701-0001 200701-0002 200701-0003
Now each master batch can have multiple final mixed batch like
200701-0001-01 200701-0001-02 200701-0001-03
and this record is inserted in to fmix table.
so i have a form in which i have a dropdown menu in which all the master batch is listed, i select 200701-0001 and that value is passed to next page where i will enter other fields data and insertion to my fmix_no will be done automatic like 200701-0001-01, 200701-0001-02 and so on,
how to achieve this
so in short each master batch will have more than one final mixed batch.
pls help, also if u have any online contact in yahoo or msn pls send me, i am so confused and badly struck deadline is just couple of hours away. my yahoo id is(E-Mail address blocked: See forum rules) you can PM me i am online right now.
I want To handel the error messages by myself in one part in my script. I know that in VB I can Use the statment - On error resume next And I also know that I can retrive the Error Number In VB with Err.Number.
How can I handel the errors by myself in ASP? I heard about the ASPErr Object, Is it the same thing like the err object in VB?
This is a follow up to a question I asked two weeks ago which I thought was solved but on further inspection I realised it wasn't working fully. I have an ORDER BY on my search results page, the search uses two dropdown menus, the first one is start character (A-Z), and the other is grade.
The problem I have is that the ORDER BY work perfectly when I leave the start character dropdown blank, and when I use the grade selection dropdown, but when I select a start character I get this error message:
An ASP page outputs data from the query "Select ThisAndThat from comments WHERE pageURL='" & pageURL & "' ORDER BY threadID, datesent" (Access mdb) threadID is a string (OK, I know!), which means that 103 displays before 99. Is there a way to write the SQL query to order them numerically? This would be much easier for me than changing the data type and hunting down every page that INSERTS or UPDATES the db.
I am extremely confused about how i should go about doing this: I have puled out current orders and have displayed in a table .These orders have their own order numbers.
Once the person clicks on first order,the order is displayed in a form,where the user can edit the order details and hit submit.
Now when he hits submit ,I want his to go the previous page where the orders are displayed in table ,so that he can click on the next order and process it/OR may be whent he user hits submit ,i want the next order directly to be displayed in the form.
I have a table in my database with several numbers.(2, 5, 8, 0, 9, 0).Now i retrieve the numbers to my page using "order by numbers", and my page look like this.
0 0 2 5 8 9
I want the lowest number to be first, but if the number is 0 (zero) I want it to go to the bottom.Can that be done
I have one table wich has a unique ID feild for each record and other feilds, and another table that has one field that is a number that contains the an ID from the other table and another field that contains some text.
I want to open with sql the first table, but order its records alphabetically by the text in the second table. is it possible? Code:
When I have the recordset in the order as follows, all works well: (Recordset2.Fields.Item("ProductName").Value) (Recordset2.Fields.Item("ShortDescription").Value) (Recordset2.Fields.Item("Thumbnail").Value)
Though if I have the Thumbnail first the description does'nt show.
I've got a site with PayPal and Google Checkout payment options. The checkout page formats two HTML forms, containing bespoke cart code - one posts to PayPal, the other to Google Checkout.When an order is placed, it needs to be updated back on my site, so that the order is marked as 'paid' in the database. When this is done with PayPal, I just provide a hidden field in the form called 'invoice' containing my id number for that transaction. This is returned in my IPN, and I update the database accordingly. However, I can't find a similar field in Google. Their example code all seems to be in XML and is WAAAAAAAAY more complicated than I need it to be. I just need to send a value with my cart code to Google Checkout, and have that value returned after the transaction has completed. I've set up Google Callback, and the page is being called and the order is being written to my google log txt file, I just need this to contain my order id number for the transaction so I can just add the logic to update the database based on this id number.
I've written the following piece of code which is embedded in HTML. For some reason when the script is processed the last response.write statment is displayed before the information in the while loop. I can't seem to figure out why this is happenming.
I'm working on a list of members.In my db I have two columns lastName and marriedName lastName is the member name before they got married and legLastName is their lastname after they got married.
Now I need to display theese two columns in alphabetical order in one list. If I for example have theese members: lastName, marriedName Anderson, Johnson Petersson, Svensson Nilsson, Persson Lindgren, Johnson
I want this result: Anderson Johnson (look for Andersson) Johnson(look for Lindgren) Nilsson Persson(look for Nilsson) Petersson Svensson(look for Petersson)
I am processing the variables from a form submission with a for/next loop. The problem is that the order of the variables are NOT written IN ORDER.
Form field 1 prints fine but then it jumps to Form field 9 and then back to Form field 4 then to Form field 2, etc. IS there a way to process the form variables in a loop in ORDER? field 1, field 2, field 3, etc? Code:
And one clicks on the form, and a SQL statement is executed. However, when I create the SQL statement,
INSERT INTO table1 (FormId,AdvantageId,SortOrder) VALUES (<call from form ID>,<advantages>,<advantsort>)
Then it loops to allow the next phrase to be entered. The statement also takes the value from every other sort order value including that ones that are in different lines. Which in result, gives me an error, saying the insert columns exceed that of the available columns in the table.