if we have a long query then how to check date,price by using order by?
344140
I previously answered this question for you, but I'll answer it again.\n\nYou will use UNION to join your two queries together, since you are getting the same number of columns from both queries.\n\nSELECT * FROM table WHERE PATINDEX('%$%', datepricecolumn) > 0 ORDER BY datepricecolumn\nUNION\nSELECT * FROM table ORDER BY datepricecolumn\n\nWhere:\n\ntable is the name of your table\ndatepricecolumn is the name of the column that contains the dates and prices.
828864
Bids and Ask\n\nThose who want to buy shares place a price Bid\n\nThose who want to sell shares Ask a price.\n\nWhen the order is submitted and sold the price will change accordingly. The price you see is the most recent sale or buy order.
845974
Eric is correct in that values can change as he described. However, it all depends if you want to store historic data for reporting or not. \n\nThere are many ways of doing this, and some can be quite complex - I work with datawarehouses trust me!\n\nThe easiest way for you to do this, if you are not worried about changing history, and if the data volume is low, is to probably write a simple query.\n\nThis would create a new table with the appropriate values. The fields would be the ones you want to see plus a calculated field. In the query by design editor in this calculated field, type something like:\n\nVatCost: CCur(([Products]![cost]*0.175)+[Products]![cost])\n\nVatCost - is the name of this new filed.\nCCur - converts the answer into currency\n[Products]![cost] - is the cost field from my Products table\n*0.175 - My fixed VAT calculation\n+[Products]![cost] - adding it back to my original field.\n\nIf you want to see this work:\n\n1. Create a table called products, and in this create a Product Field and a Cost Field.\n\n2. Now open the create new query. \n\n3. Choose the product table and then click close.\n\n4. If you know how to build a create table query you can do so now, otherwise go to the View menu and select the SQL View item. Then paste the following into the payne replacing anything else already there (note in this code, that I am going to store the results into a new table called NewCost)\n\nSELECT Products.product, Products.cost, CCur(([Products]![cost]*0.175)+[Products]![cost]) AS VatCost INTO NewCost\nFROM Products;\n\n5. Then use the View menu and select design view again to see what I did.\n\n6. Now select the View menu again and choose datasheet view. This runs the query to enable you to see the results without creating the table. This maybe good enough for you (in which case you could run the query as a select query ) Anyway....\n\n7. Now select the Query Menu and choose the Run Item. This will actually materialise your data as the NewCost Table.\n\nIn my version of Access 2003, running this query again automatically deletes the table before creating the new, so you may not need to write something explicit.\n\nRemember to save the query so you can run it again and again if needed. You can also edit mine with the fields and table names you require.\n\nTIP: Avoid field and table names with spaces. If you must have spaces, or already have tables you do not want to change, wrap these names in square brackets like:\n\n[Product Code]\n\n\nHope this helps let me know if not.
272795
Please clearify your question.  This doesn't make much sense.\n\nSounds like you'll need to use a SELECT..CASE or an IF..THEN.
578061
Supposing the following:\n1. You're table name is tblInventory\n2. You're product code is called ProdCode\n3. You have a field called [SoldQty]\n4. You're on a form that has a field called "QtyPurchased"\n5. You're form has a field that contains the ProdCode for the item you sold...\n\nOnce the sale is complete you can do:\n\nDoCmd.RunSql "update tblInventory set [SoldQty]=[SoldQty]+" & me.QtyPurchased where ProdCode=" & me.ProdCode
520398
You should run it through "explain plan" and depend on the output decide how to optimize your query
155823
in your query to the database, include criteria on the date field to filter the data retrieved.. or simply include an 'ORDER BY 'statement in the SQL statement to sort your data then you can simple manipulate the data
1124246
1) Consider adding another field that records last date when the record was changed or a record version number so that you have a single field to test against.\n\n2) Then (depending on technology - is this Oracle, SQL, Access???) look at what sort of indexing you have set up.  This can dramatically speed up performance.
1011647
My coldfusion is pretty rusty (php guy now) but the first question that comes to mind is, rather than use 2 seperate queries, why not use one?\n\nTry SELECT * .... etc\n\nWHERE order_ID = (SELECT MAX(order_ID) FROM Orders)\nORDER BY ... etc.\n\nThis is called a subquery or correlated subquery.  Most SQL databases support the idea.
312052
You could use "select * from table_name where char_field_name like '%'".\n\nBut it would be better to remove the where clause, as this will save up some system resource during the SQL execution.
601078
You need to create an extremely large varchar variable and then you need to cursor thru your table and find all the Note Times that are 5/2/2006 or whatever note time you want them to be. Then you need to append the note time and the note to the end of your varchar variable.\n\nGoogle Cursors in SQL to see how cursoring thru a table is done.\n\nNOTE: As a software developer I cannot in my professional capacity condone the use of cursors. Personally I think they are a huge waste of performance.
54117
You cant index a normal view.\nBut you can index a materialized view.
199904
You can check on Yahoo stocks.  They list the after hours price too, but only in the evening hours.
103351
to test what is quicker create a giant table of data (cross join query is really good at making tons of entries fast) then run the query 100 times on a table of 100,000 entries. (some slow queries you wont need nearly this many entries)\n\nTake note of the execution time and run the other way. You can then tweak the code and see whats faster. I got a sproc that took 1:30 seconds to aggregate and massage a years worth of 15 minute data to run in 0:02 seconds using this method and a little persistance...\n\ngood luck
70671
I believe you can right click on it and select properties.  It gives a "created" date (that I don't believe is accurate -- just tried that with a website I administer) and a "last modified" date (which was accurate on that one).
719712
select  to_char(news_date,'dd-mm-rrrr') from tbl_news.\nassumption news_date field is  of datatype date
924206
to display the records from Sales table and Purchase table, do like Monalisa said, but he/she missing 'WHERE' query.\n\nassume :\nCreate Table Sales (Sales_Date date, total integer);\nCreate Table Purchase (Purchase_Date, total integer);\n\nSelect Sales_Date, Total from SALES where\nSales_Date>='10/03/2006' and Sales_Date<='10/09/2006'\nunion all\nSelect Purchase_Date, Total from PURCHASE where\nPurchase_Date>='10/03/2006' and Purchase_Date<='10/09/2006'\n\nNotes :\n'UNION' will eliminate the same records from PURCHASE table.\nto get all records we must use 'UNION ALL' .\n\nTo sum sales and purchase in 3rd to 9th oct  :\n\nSelect sum(A.Total) as TotalSales, sum(B.Total) as TotalPurchase from SALES as A, PURCHASE as B where A.Sales_Date>='10/03/2006' and A.Sales_Date<='10/09/2006'\nand B.Purchase_Date>='10/03/2006' and B.Purchase_Date<='10/09/2006'\n\nps :\nmy query format maybe have a little different with ms Access query format, so if my query can't run in ms Access, try to change it to ms Access query format.