Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. mjd3000

    update question

    I am trying to do an update of a field based where I am getting the data from a join between 2 other tables. Can somebody tell me what is wrong with my syntax below? update ContactExtensionBase set New_DateEnquiryTaken = ( SELECT l.createdon FROM ContactBase c inner join LeadBase l...
  2. mjd3000

    ORDER BY items must appear in the select list

    I don't get it though...I am able to order by Percentage or by Name, but when I add the CASE part, I get this error
  3. mjd3000

    ORDER BY items must appear in the select list

    Can somebody please tell me what is wrong with this SQL? I am getting the following error whenever I add the final line : 'ORDER BY items must appear in the select list if the statement contains a UNION, INTERSECT or EXCEPT operator' select * from ( SELECT top 5 COUNT(*) AS 'TotalEnquiries'...
  4. mjd3000

    ordering with 'other'

    I have a result set like this : Other 34% Dan 24% Ken 17% Claire 16% Helen 9% How do I other this so that the Other always shows as the last row, even if it isn't the lowest percentage?
  5. mjd3000

    union and top operator with order

    I'm using SQL 2005..here is the full SQL including the union : --select * from --( SELECT top 5 COUNT(*) AS 'TotalEnquiries', createdbyname as 'Name', round(100 * CAST(COUNT(*) as float) / (SELECT COUNT(*) AS Expr1 FROM FilteredLead where createdonutc between DateAdd(Day...
  6. mjd3000

    union and top operator with order

    I have a problem with my SQL. I am trying to order a top expression with a union, but the union prevents me from using order by. Here is my SQL before the union. How do I change this to work with order by? SELECT top 5 COUNT(*) AS 'TotalEnquiries', createdbyname as 'Name', round(100 *...
  7. mjd3000

    rounding up percentages

    This now gives me the top 5 but ordered by name rather than by count(*) : SELECT top 5 COUNT(*) AS 'Total Enquiries', createdbyname as 'Name', round(100 * CAST(COUNT(*) as float) / (SELECT COUNT(*) AS Expr1 FROM FilteredLead where createdonutc between DateAdd(Day...
  8. mjd3000

    rounding up percentages

    I am using a union, but having problems getting a sum for the top 5 values. Here is my SQL, can anybody help? SELECT top 5 COUNT(*) AS Expr1 FROM FilteredLead where createdonutc between DateAdd(Day, DateDiff(Day, 0, GetDate()-6), 0) And DateAdd(day, DateDiff(Day, 0, GetDate() + 1)...
  9. mjd3000

    rounding up percentages

    Sorry, my current SQL should read like this : SELECT top 5 createdbyname as 'Name', COUNT(*) AS 'Total Enquiries', round(100 * CAST(COUNT(*) as float) / (SELECT COUNT(*) AS Expr1 FROM FilteredLead where createdonutc between DateAdd(Day, DateDiff(Day, 0, GetDate()-6), 0) And...
  10. mjd3000

    rounding up percentages

    Thanks drlex...I have one more question regarding this, I don't know if you could help me, but I currently have this output : No % Claire Marshall 37 22 Frances Kennedy 35 21 Ken Fletcher 25 15 guestuser User 20 12 Naomi Manuel 19 11 And I want this output ...
  11. mjd3000

    rounding up percentages

    I have the following SQL to calculate percentages which works fine, but because it is rounding down for example 0.7 to 0 and 15.6 to 15, the total is no where near 100%. Can anybody tell me how to do this so it rounds up correctly? SELECT createdbyname, COUNT(*) AS 'Total', 100 * COUNT(*)...
  12. mjd3000

    accessing XML data

    I have some XML (see snippet below) and I have got so far with it, but I don't know how to get at the text within the <Value> tags : <ResponseGroup refID="AnswerGroup184"> <ResponseText refID="Textbox25"> <Value>Mike</Value> </ResponseText> <ResponseText...
  13. mjd3000

    putting border around image

    I am reading an image from a database and writing it to the screen. But now I also need to put a border around this image. Here is my code : public void showSelectedImage(string strEncodedImage) { Response.Clear(); Response.ContentType = "image/jpeg"...
  14. mjd3000

    blank System.Drawing.Image

    How would you go about creating a blank System.Drawing.Image object (i.e. an image with just a white backcolour)?
  15. mjd3000

    viewing multiple System.Drawing.Image objects

    I am creating a number of System.Drawing.Image objects in my code, and I want to be able to add them to an object such as a Panel so that I can view them all together on screen. Is there a way to do this?
  16. mjd3000

    resizing images 2

    I am working from this example to resize an image : http://aspnet.4guysfromrolla.com/articles/012203-1.2.aspx I have converted most of the code to C# : Response.Clear(); Response.ContentType = "image/jpeg"; System.Drawing.Image image = retrieveImage(strEncodedImage)...
  17. mjd3000

    resizing images

    I am displaying images from a database using the code below. Is there any way I can resize the images before rendering them? public void showSelectedImage(string strEncodedImage) { Response.Clear(); Response.ContentType = "image/jpeg"; System.Drawing.Image image...
  18. mjd3000

    show image

    I have images in my database that are stored as bytes, and I want to show them on screen on my webpage. I can do this with the code below : Response.Clear(); Response.ContentType = "image/jpeg"; System.Drawing.Image image = retrieveImage(strEncodedImage)...
  19. mjd3000

    post parameters to url

    What would the syntax be? I am unfamiliar with Javascript.
  20. mjd3000

    post parameters to url

    How do I post parameters to a web page in Javascript? I want to do the equivalent of this : "http://webpage.aspx?param=1

Part and Inventory Search

Back
Top