Gossamer Forum
Home : General : Databases and SQL :

Numbering database entries? Script inside

Quote Reply
Numbering database entries? Script inside
This is just a little script I'm using to organize my client database for a tax company so I can separate the clients I've done recently from other clients. Is there any way I could number these?



Select * FROM AllReturnsIndividual
WHERE
(
Month(AllReturnsIndividual.[Last Touched]) = 12
AND
Year(AllReturnsIndividual.[Last Touched]) = 2002
)
OR
(
Month(AllReturnsIndividual.[Last Touched]) >= 1
AND
Year(AllReturnsIndividual. [Last Touched]) = 2003



Please email me or respond here with any suggestions. Thanks!



Solaron
Quote Reply
Re: [solaron] Numbering database entries? Script inside In reply to
Please can you explain a little more. When you say "number" what exactly do you require?
Quote Reply
Re: [Paul] Numbering database entries? Script inside In reply to
Sorry about that. For example, we have about 5000 previous clients in our database. We've done about 3000 of them again this year, and about 450 new ones so far. The script pulls them all up, but I don't know exactly how many there are... I just scroll down/scroll up. I could tediously count them one by one, which I may have to do... but I'd like to know if I can add a column which will just number itself, even if its separate from everything else (bear with me, I'm a network admin and very new with db). Each entry I see is only a single line, so a column going down that was numbered 1-whatever would at least let me see how many I have... make sense? If no, lemme know and I'll try and think of a way I can do this. :|



Thanks!

Scott
Quote Reply
Re: [solaron] Numbering database entries? Script inside In reply to
Ok I think if I understand correctly you just need to add a new column, called, say "ID" - make it INT with length 8 or so and then set it to auto_increment and then it will keep count itself.

Last edited by:

Paul: Feb 10, 2003, 8:00 AM
Quote Reply
Re: [Paul] Numbering database entries? Script inside In reply to
Uh.... heh. Blush Anything I can add to my script to do that? I was up all night looking things up just to figure that much out. I'm reallllly not very good with DB yet... forgive me.

Thanks much for your fast responses, by the way Paul!



Scott
Quote Reply
Re: [solaron] Numbering database entries? Script inside In reply to
If you use mysql a really good tool is mysqlman made by Gossamer...

http://gossamer-threads.com/...s/mysqlman/index.htm

You just enter your database username and password and you will be logged into to an admin panel where you can administer your database from your browser.