16:12.50 | *** join/#udbug fungus (n=olsonl@bromine.sosstaffing.com) |
16:12.50 | *** mode/#udbug [+o fungus] by ChanServ |
16:17.52 | *** join/#udbug thebigdog (n=thebigdo@70.103.91.98) |
21:29.44 | *** join/#udbug brasto (n=brasto@66-182-82-217.static.slcl007.digis.net) |
21:29.44 | *** mode/#udbug [+o brasto] by ChanServ |
21:42.56 | *** join/#udbug murdock_ut (n=chatzill@mail.kimballequipment.com) |
21:43.07 | murdock_ut | Howdy all. |
21:43.56 | murdock_ut | I'm working with some student attendance data. I've been asked to find out which students have 10 consecutive absences. Can someone give me some hints on how I would do this? |
21:51.29 | thebigdog | which database are you using? |
21:51.48 | fungus | I think you will need to pull the data out, and process it in code. |
21:52.32 | murdock_ut | sorry. |
21:52.35 | murdock_ut | Um mysql. |
21:53.49 | murdock_ut | I was hoping to do it all in SQL so I can use my report writer. |
21:54.00 | murdock_ut | mysql that is. |
21:54.25 | thebigdog | which version of mysql? |
21:54.32 | thebigdog | you could do it in a stored proc |
21:54.47 | thebigdog | but that is pretty indept coding...unless you are familiar with it |
21:56.28 | murdock_ut | 5.0 |
21:56.48 | murdock_ut | I've just done some some simple functions. |
22:00.55 | thebigdog | i can point you to some queries for it...but they are complex |
22:01.10 | murdock_ut | That will be a good start. |
22:01.11 | thebigdog | that is why fungus mentioned doing it outside sql |
22:01.17 | murdock_ut | Sure. |
22:01.25 | thebigdog | http://www.artfulsoftware.com/infotree/queries.php?&bw=1234#577 |
22:01.43 | thebigdog | that is a query to find available reservations...which is very similar to what you are doing |
22:02.20 | thebigdog | and this one too http://www.artfulsoftware.com/infotree/queries.php?&bw=1234#71 |
22:02.28 | thebigdog | it would be a combo of those t2o |
22:02.58 | thebigdog | if i where doing it though i would be using a stored procedure to do it |
22:03.39 | thebigdog | but it is also dependent on how your db tables are setup too |
22:04.13 | fungus | stored procs are harder than your favorite language most of the time. But your need sounds different. |
22:05.30 | thebigdog | and datediff will be your friend...your very best friend |
22:06.55 | murdock_ut | I'm sure I could figure out how to do it in PHP but I I want to use my report designer then I needs to be done in sql. I feel a headache coming one. :) |
22:07.32 | thebigdog | it will be hard in sql |
22:07.40 | thebigdog | very hard |
22:07.56 | thebigdog | that is one plus of postgresql |
22:08.03 | thebigdog | they have an overlap feature that is nice |
22:17.38 | murdock_ut | Wouldn't I want a function, not a stored proc? |
22:26.16 | thebigdog | a function is limited |
22:28.49 | murdock_ut | Can you return a value with a stored proc? |
22:41.45 | thebigdog | yes |
22:41.58 | thebigdog | you can return anything really |
22:42.11 | thebigdog | but it allows you to do logic and cursos |
22:42.14 | thebigdog | cursors |
22:42.25 | thebigdog | allows you to do other queries inside |
23:27.01 | murdock_ut | functions do not huh. |
23:49.36 | thebigdog | no functions are not |
23:50.39 | thebigdog | and they are typically used for triggers |
23:52.54 | thebigdog | if you are really good at c you could probably write a function in c and it would be extremely fast |