Jump to content

lordfa9

Members
  • Content Count

    43
  • Joined

  • Last visited

Community Reputation

0 Neutral

About lordfa9

  • Rank
    Newbie
  1. lordfa9

    Change coloum name

    I need to change the column name of one of my tables for example ItemID ItemName1 Coffee changed to StockID StockName1 Coffee i need an SQL statement to do that, i want the name to be changed (instead of using an AS command)I was also reading something about using the ALTER TABLE and ALTER COLUMN commands, are these the correct command(s) to use and if so, how do i use them in a statement?
  2. i think what he means is to use MAX(taskid) for the select statement and to use a 'GROUP BY CustID'i'm not sure about the group by thing though, i think you have to use DISTINCT(CustID) in your select statement
  3. your answer is really going around me, seeing as that i don't really understand the terms you are using: open recordset load all the data into a dictionary first, and then iterate through the dictionary so do you mean that each coloum has its individual sql statement?
  4. i think you can try using WHERE here:select a,b,c,d,e,sum(f) from table WHERE X= bla blagroup by a,b,c,d,e, x having sum(f)>0"not sure if it works though, if not try removng the X from the group by clause
  5. I think you missed out on soemthing the phrase you want to use for the LIKE statement should have a * at the start and endTry this SELECT department FROM yourtablename WHERE item_name NOT LIKE "*Geo positioning system*"
  6. Ooo so its like such: SELECT Stock.Item, Stock.Itemname, Sum(Stock.QTY) AS TOTAL_QUANTITYFROM StockGROUP BY Stock.ITEM, Stock.Itemname; So this means that all the rows not using the aggregrate function has to be added to the group by?
  7. lordfa9

    INNER JOIN QN

    so you mean the code has to be like this?sql="SELECT Subcode, DateGiven, DateDue, Information & _FROM " & tblname & " & _Order BY " & sort & " " & ordering & "" & _
  8. lordfa9

    INNER JOIN QN

    recreated my file, seems to work now :)might be hardware or software though, i am now using a new platform.By the way, just a general query, when coding or coding general in notepad (Platform migration: Dreamweaver----> Notepad not good ). If i do the following to a piece of code will there be any difference? sql="SELECT Subcode, DateGiven, DateDue, Information FROM " & tblname & " Order BY " & sort & " " & ordering & "" typed in one complete line (notepad expands horizontally forever)or If i press enter to shift the various parts code to a new line eg. sql="SELE
  9. I have the following tables, for simplicity I only include one row from eachLOCA ItemCode QtyFish 20 LOC B ItemCode QtyFish 30 Is there any way I can get the script to display as such: ItemCode LOCA LOCBFish 20 30 And so on and so forth for every extra item?
  10. I have the following SQL statementSELECT Stock.Itemcode, Sum(Stock.QTY) AS TOTAL_QUANTITYFROM StockGROUP BY Stock.Itemcode;This SQL works fine, however when I add itemname to the statement:SELECT Stock.Itemcode, Stock.Itemname, Sum(Stock.QTY) AS TOTAL_QUANTITYFROM StockGROUP BY Stock.ITEM; It gives me the error ‘You tried to execute a query that does not include the specified expression ‘itemname’ as part of an aggregate function’. Background: there may be more than one entry of the same item in the table (it’s a result of the merging of a few tables) and the first statement is to calculate th
  11. Let's say I have these two tables:LOC A Itemcode QtyFish 1Meat 3Eggs 4 LOC B Itemcode QtyFish 4Meat 3Eggs 1 How do I merge them together using a macro in Ms Access so that I get a table with the total of all the items? For example: Itemcode QtyFish 5Meat 6Eggs 5
  12. Do you have Macromedia Dreamweaver?if you do (and not to confuse you) its better to use a frameset.
  13. I made a change to the figures (in bold) it helps me to explain easierI then will try to explain what is written:what the paragraph says is that the code will generate a frame where the page is divided into two parts downwards (imagine a line running down your screen), the page on the left (taking up 25% of the screen) is the page frame_a.htm while the one on the right is frame_b.html. Both pages are displayed on your screen at the same time, sharing space.Anyway I think it's best to use dreamweaver to create a frame, it allows you to set the hight and width easily.
  14. just to add on, to submit data into the database you will have to use an INSERT statement, using the variablesMore info on how to submit variables can be found on the w3schools tutorial
  15. lordfa9

    search engine

    For example if you want to search for peppers in your "vegetables' table, your sql will be like thisSELECT * FROM vegetablesWHERE name LIKE "*peppers*"this will return red peppers, green peppers etc etcyou can substitute peppers for a user submitted value
×
×
  • Create New...