Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 6 of 6 total |
DESCENDING ORDER |
Mon, Apr 7 2008 5:29 PM | Permanent Link |
"John Postnikoff" | I have a form with two grids for which I would like to print differnet
results from each grid. I would like to show the last orders in in one of the grids with the most recent records on top of the grid, and a different view on the second grid. My SQL statements below do not seem to work. Select * from neworders order by itemnumber desc; or Select * from neworders order by itemnumber desc top 100; Aside from trying to get the order in my preference, it seems when I use the two grids the record pointer goes to the same record of both grids. I am sharing the same table. How can I get around this. John |
Mon, Apr 7 2008 11:54 PM | Permanent Link |
Steve Forbes Team Elevate | Hi John,
It sounds like you may be using the same Dataset for both grids, is this the case? If so, there are a couple of alternatives that will produce the desired result .. 1. Load both grids from the same query/table (i.e. dataset), detach and then use the grids internal sorting to display in the desired order, or 2. Attach each grid to its own dataset i.e. grid1 -> Query1 -> SQL -> "SELECT * FROM neworders ORDER BY itemnumber" grid2 -> Query2 -> SQL -> "SELECT * FROM neworders ORDER BY itemnumber DESC" HTH -- Best Regards Steve [Team Elevate] "John Postnikoff" <john@trackinfosystems.net> wrote in message news:6E9B60E0-6148-4157-82D8-EE32FE80633C@news.elevatesoft.com... >I have a form with two grids for which I would like to print differnet > results from each grid. I would like to show > the last orders in in one of the grids with the most recent > records on top of the grid, and a different view on the second grid. > > My SQL statements below do not seem to work. > > Select * from neworders order by itemnumber desc; > > or > > Select * from neworders order by itemnumber desc top 100; > > Aside from trying to get the order in my preference, it seems when I use > the > two grids the record pointer goes to the same record of both grids. I am > sharing the same table. How can I get around this. > > John > > > > > > |
Tue, Apr 8 2008 10:42 AM | Permanent Link |
"John Postnikoff" | I have tried to connect the data to their own table or query components,
even though they share the same table. So I am not sure what the work around for this. I cannot get the records to display in descending order on any of the grids, even after just trying just one grid. John "Steve Forbes [Team Elevate]" <ozmosys@spamfreeoptusnet.com.au> wrote in message news:43CA0862-AFB6-4E61-A5C8-22F24D8D4E13@news.elevatesoft.com... > Hi John, > > It sounds like you may be using the same Dataset for both grids, is this the > case? If so, there are a couple of alternatives that will produce the > desired result .. > > 1. Load both grids from the same query/table (i.e. dataset), detach and then > use the grids internal sorting to display in the desired order, or > 2. Attach each grid to its own dataset i.e. > > grid1 -> Query1 -> SQL -> "SELECT * FROM neworders ORDER BY itemnumber" > grid2 -> Query2 -> SQL -> "SELECT * FROM neworders ORDER BY itemnumber DESC" > > HTH > > -- > > Best Regards > > Steve > [Team Elevate] > > "John Postnikoff" <john@trackinfosystems.net> wrote in message > news:6E9B60E0-6148-4157-82D8-EE32FE80633C@news.elevatesoft.com... > >I have a form with two grids for which I would like to print differnet > > results from each grid. I would like to show > > the last orders in in one of the grids with the most recent > > records on top of the grid, and a different view on the second grid. > > > > My SQL statements below do not seem to work. > > > > Select * from neworders order by itemnumber desc; > > > > or > > > > Select * from neworders order by itemnumber desc top 100; > > > > Aside from trying to get the order in my preference, it seems when I use > > the > > two grids the record pointer goes to the same record of both grids. I am > > sharing the same table. How can I get around this. > > > > John > > > > > > > > > > > > > > |
Tue, Apr 8 2008 11:06 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | John
On you form make sure you have two grids, two TDBISAMQuerys and two datasources Link as follows: grid a -> datasource a -> query a grid b-> datasource b-> query b Set query a's sql to Select * from neworders order by itemnumber desc Set query b's sql to Select * from neworders order by itemnumber Open query a and b You should now have one grid showing the data in descending order and the other in ascending order. If that fails please zip your project, post to the binaries newsgroup and I'll sort it out. Roy Lambert [Team Elevate] |
Tue, Apr 8 2008 3:12 PM | Permanent Link |
"Robert" | "John Postnikoff" <john@trackinfosystems.net> wrote in message news:93856BC2-F0F8-4169-BF5F-15132A3D48AA@news.elevatesoft.com... >I have tried to connect the data to their own table or query components, > even though they share the same table. So I am not sure what the work > around > for this. > > I cannot get the records to display in descending order on any of the > grids, > even after just trying just one grid. > What happens if you run the query in DBSYS? Robert > John > > "Steve Forbes [Team Elevate]" <ozmosys@spamfreeoptusnet.com.au> wrote in > message news:43CA0862-AFB6-4E61-A5C8-22F24D8D4E13@news.elevatesoft.com... >> Hi John, >> >> It sounds like you may be using the same Dataset for both grids, is this > the >> case? If so, there are a couple of alternatives that will produce the >> desired result .. >> >> 1. Load both grids from the same query/table (i.e. dataset), detach and > then >> use the grids internal sorting to display in the desired order, or >> 2. Attach each grid to its own dataset i.e. >> >> grid1 -> Query1 -> SQL -> "SELECT * FROM neworders ORDER BY itemnumber" >> grid2 -> Query2 -> SQL -> "SELECT * FROM neworders ORDER BY itemnumber > DESC" >> >> HTH >> >> -- >> >> Best Regards >> >> Steve >> [Team Elevate] >> >> "John Postnikoff" <john@trackinfosystems.net> wrote in message >> news:6E9B60E0-6148-4157-82D8-EE32FE80633C@news.elevatesoft.com... >> >I have a form with two grids for which I would like to print differnet >> > results from each grid. I would like to show >> > the last orders in in one of the grids with the most recent >> > records on top of the grid, and a different view on the second grid. >> > >> > My SQL statements below do not seem to work. >> > >> > Select * from neworders order by itemnumber desc; >> > >> > or >> > >> > Select * from neworders order by itemnumber desc top 100; >> > >> > Aside from trying to get the order in my preference, it seems when I >> > use >> > the >> > two grids the record pointer goes to the same record of both grids. I >> > am >> > sharing the same table. How can I get around this. >> > >> > John >> > >> > >> > >> > >> > >> > >> >> > > |
Tue, Apr 8 2008 10:18 PM | Permanent Link |
"Walter Matte" | Whose grid are you using? The plain DBGrid that comes with Delphi, respects
the SQL Order ok, but others like DB Express you can override the SQL Order and do your own sorting within the DevEx Grids depending on what properties you have tinkered with.... Walter "John Postnikoff" <john@trackinfosystems.net> wrote in message news:93856BC2-F0F8-4169-BF5F-15132A3D48AA@news.elevatesoft.com... >I have tried to connect the data to their own table or query components, > even though they share the same table. So I am not sure what the work > around > for this. > > I cannot get the records to display in descending order on any of the > grids, > even after just trying just one grid. > > John > > "Steve Forbes [Team Elevate]" <ozmosys@spamfreeoptusnet.com.au> wrote in > message news:43CA0862-AFB6-4E61-A5C8-22F24D8D4E13@news.elevatesoft.com... >> Hi John, >> >> It sounds like you may be using the same Dataset for both grids, is this > the >> case? If so, there are a couple of alternatives that will produce the >> desired result .. >> >> 1. Load both grids from the same query/table (i.e. dataset), detach and > then >> use the grids internal sorting to display in the desired order, or >> 2. Attach each grid to its own dataset i.e. >> >> grid1 -> Query1 -> SQL -> "SELECT * FROM neworders ORDER BY itemnumber" >> grid2 -> Query2 -> SQL -> "SELECT * FROM neworders ORDER BY itemnumber > DESC" >> >> HTH >> >> -- >> >> Best Regards >> >> Steve >> [Team Elevate] >> >> "John Postnikoff" <john@trackinfosystems.net> wrote in message >> news:6E9B60E0-6148-4157-82D8-EE32FE80633C@news.elevatesoft.com... >> >I have a form with two grids for which I would like to print differnet >> > results from each grid. I would like to show >> > the last orders in in one of the grids with the most recent >> > records on top of the grid, and a different view on the second grid. >> > >> > My SQL statements below do not seem to work. >> > >> > Select * from neworders order by itemnumber desc; >> > >> > or >> > >> > Select * from neworders order by itemnumber desc top 100; >> > >> > Aside from trying to get the order in my preference, it seems when I >> > use >> > the >> > two grids the record pointer goes to the same record of both grids. I >> > am >> > sharing the same table. How can I get around this. >> > >> > John >> > >> > >> > >> > >> > >> > >> >> > > |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |