Things I suck at

View previous topic View next topic Go down

Things I suck at

Post by Opens The Cage on Tue Apr 12, 2011 4:47 am

Me: Hey, Access 2007 Database, can I get records 50-100 out of that table? I don't want the first 50 or anything after 100, just that middle set would be nice.

SQL: Ye can't get ye flask.

Me: Why not? I even looked up the HAVING clause, which I'm pretty sure you just made up because you suck at having a good WHERE clause.

SQL: I said, ye can't get ye flask.

Me: Access, you suck. You'd have driven me to drinking was tech support not already acting as my chauffeur to the liquor store.

SQL: Exit Dennis.

Me: That's not even funny now. Stop it.
avatar
Opens The Cage

Posts : 394
Join date : 2011-01-15

View user profile

Back to top Go down

Re: Things I suck at

Post by Misha on Tue Apr 12, 2011 1:51 pm

This amuses me.
avatar
Misha

Posts : 954
Join date : 2010-09-13

View user profile

Back to top Go down

Re: Things I suck at

Post by Anselm Walker on Tue Apr 12, 2011 2:53 pm

This is 'Murica. We talk 'Murican here.
avatar
Anselm Walker

Posts : 736
Join date : 2010-08-25
Age : 26
Location : Lima, OH

View user profile

Back to top Go down

Re: Things I suck at

Post by HST Justin on Tue Apr 12, 2011 3:10 pm

Should have used the keys rather than the number of rows. After all, a database doesn't keep secret track of whether a row is row 1 or row 50. That's what database keys are for. If you don't have those? Just pull it all out into Excel and get the middle.

_________________
They're all gonna laugh at you...
avatar
HST Justin
Storyteller
Storyteller

Posts : 729
Join date : 2010-08-25
Age : 33
Location : Cleveland, OH

View user profile

Back to top Go down

Re: Things I suck at

Post by Opens The Cage on Tue Apr 12, 2011 3:28 pm

My key is an AutoNumber, so it's (ideally) numbered and ordered by time inserted for me. Access doesn't seem to have any simple way to skip X rows before displaying a set in one command.

This is basically an event log, and the user wants to see 50 at a time, and move forward/back in sets of 50. My end result is that I do two queries: one to get MAX(RecordKey), and one to get the rows WHERE (RecordKey < MaxKeyValue -(PageNum * 50) AND RecordKey > (PageNum * 50) + 50). I though you couldn't do that in one command, since doing math in a WHERE clause with MAX() demands you use a HAVING clause instead, which wasn't giving me the right results. I now see that this might be a side effect of the horrid scripting language this platform uses mangling the order of operations rather than Access, but I've gotten something that works not so I'm not breaking it again to check.

Still, when some databases let you go "SELECT TOP 50 SKIP 50 FROM EventLog", it makes me sad knowing that I have to waste time finding something that works the same.

Were my entire job moving things around in databases, I'd probably have not needed to make this thread, because I wouldn't suck at this. As is, it's only one of a truckload of things I do.
avatar
Opens The Cage

Posts : 394
Join date : 2011-01-15

View user profile

Back to top Go down

Re: Things I suck at

Post by Graciela on Tue Apr 12, 2011 7:19 pm

^Looks at the above, headache blooms. Walks away ^

Graciela

Posts : 1310
Join date : 2010-08-28
Age : 33

View user profile

Back to top Go down

Re: Things I suck at

Post by Opens The Cage on Tue Apr 12, 2011 7:20 pm

Programming? In my OOC thread? It's more likely than you think.
avatar
Opens The Cage

Posts : 394
Join date : 2011-01-15

View user profile

Back to top Go down

Re: Things I suck at

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum