Click here to Skip to main content
15,897,518 members
Home / Discussions / Database
   

Database

 
GeneralRe: Count (*) Pin
Peter Mayhew14-Mar-04 9:30
Peter Mayhew14-Mar-04 9:30 
GeneralRe: Count (*) Pin
Peter Mayhew14-Mar-04 9:56
Peter Mayhew14-Mar-04 9:56 
GeneralRe: Count (*) Pin
-Dr_X-14-Mar-04 10:17
-Dr_X-14-Mar-04 10:17 
GeneralRe: Count (*) Pin
-Dr_X-14-Mar-04 10:06
-Dr_X-14-Mar-04 10:06 
GeneralRe: Count (*) Pin
Peter Mayhew15-Mar-04 4:48
Peter Mayhew15-Mar-04 4:48 
GeneralRe: Count (*) Pin
dishanf14-Mar-04 18:39
dishanf14-Mar-04 18:39 
GeneralRe: Count (*) Pin
Peter Mayhew15-Mar-04 4:52
Peter Mayhew15-Mar-04 4:52 
GeneralRe: Count (*) Pin
Peter Mayhew15-Mar-04 10:12
Peter Mayhew15-Mar-04 10:12 
OK, now i have working code to count all the records thanks for all your suggestions, that’s all fine now.

The other thing that I wanted to clear up was this, and i'll do my best at explaining!

I wanted to select all the data in a table, then sort in descending order (the primary being a Autonumber called ID), and then select a range of records for paging.

Now i can do the paging fine, the the first record is shown first, and wanted everything to be in reverse order. So my first bit of code works, in ascending order. (ignore the maths bit its used to select ie records 1-5 for page 1 and 6-10 for page 2 ...)


SQLQuery = "SELECT * FROM Log WHERE Log.ID BETWEEN " & (((sCurrentpage-1)*5)+1) & " AND " & (sCurrentpage*5)

This works fine, but I wanted it to have all the records in reverse order, so I thought ah ha, i'll just put in order by:

SQLQuery = "SELECT * FROM Log ORDER BY ID DESC WHERE Log.ID BETWEEN " & (((sCurrentpage-1)*5)+1) & " AND " & (sCurrentpage*5)

But this doesn't work.
If I were to put ORDER BY ID DESC at the end of the SQL statement it will work, but it will only reverse order of the selected records.
But i wanted to reverse order of everything and then select..understand the problem??

Suggestions on a post card.. Please note, I am not able to use anything to do with .NET, so i need .NETless code Blush | :O ..cheers!

---
Peter M
GeneralRe: Count (*) Pin
-Dr_X-15-Mar-04 11:49
-Dr_X-15-Mar-04 11:49 
Generalsql statements Pin
pnpfriend12-Mar-04 9:02
pnpfriend12-Mar-04 9:02 
GeneralRe: sql statements Pin
Henrik Stuart12-Mar-04 9:15
Henrik Stuart12-Mar-04 9:15 
GeneralRe: sql statements Pin
dishanf14-Mar-04 18:42
dishanf14-Mar-04 18:42 
GeneralRe: sql statements Pin
Arjan Einbu14-Mar-04 21:00
Arjan Einbu14-Mar-04 21:00 
GeneralRecordset dim problem Pin
Fabio Panzavolta12-Mar-04 3:39
Fabio Panzavolta12-Mar-04 3:39 
GeneralRe: Recordset dim problem Pin
l a u r e n18-Mar-04 18:54
l a u r e n18-Mar-04 18:54 
GeneralCreating a new access database using ADO.NET Pin
pankajdaga11-Mar-04 2:20
pankajdaga11-Mar-04 2:20 
GeneralRe: Creating a new access database using ADO.NET Pin
Mike Ellison11-Mar-04 6:15
Mike Ellison11-Mar-04 6:15 
GeneralRe: Creating a new access database using ADO.NET Pin
pankajdaga11-Mar-04 19:38
pankajdaga11-Mar-04 19:38 
GeneralSQL Server Access rights Pin
Nick Seng10-Mar-04 17:48
Nick Seng10-Mar-04 17:48 
GeneralRe: SQL Server Access rights Pin
Mike Dimmick11-Mar-04 2:29
Mike Dimmick11-Mar-04 2:29 
GeneralRe: SQL Server Access rights Pin
Nick Seng11-Mar-04 14:18
Nick Seng11-Mar-04 14:18 
GeneralSQL code and datagrid Pin
ASGill10-Mar-04 13:24
ASGill10-Mar-04 13:24 
GeneralRe: SQL code and datagrid Pin
MasudM10-Mar-04 22:23
MasudM10-Mar-04 22:23 
GeneralRe: SQL code and datagrid Pin
ASGill11-Mar-04 2:04
ASGill11-Mar-04 2:04 
GeneralRe: SQL code and datagrid Pin
MasudM11-Mar-04 5:14
MasudM11-Mar-04 5:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.