Jump to content

noob needs help with comparing feilds..


fxr

Recommended Posts

hi i am working on a web application and i am stuck..

 

i have a table that looks like this:

 

 

....time.........................quote....dif
| 2008-03-17 00:00:00 | 15000 | |
| 2008-03-17 00:30:00 | 15002 | |
| 2008-03-17 01:00:00 | 15004 | |
| 2008-03-17 01:30:00 | 15006 | |
| 2008-03-17 02:00:00 | 15008 | |
| 2008-03-17 02:30:00 | 15010 | |
| 2008-03-17 03:00:00 | 15008 | |
| 2008-03-17 03:30:00 | 15006 | |
| 2008-03-17 04:00:00 | 15004 | |
| 2008-03-17 04:30:00 | 15002 | |
| 2008-03-17 05:00:00 | 15000 | |
| 2008-03-17 05:30:00 | 15002 | |
| 2008-03-17 06:00:00 | 15004 | |
| 2008-03-17 06:30:00 | 15006 | |
| 2008-03-17 07:00:00 | 15008 | |
..etc etc

 

i wanna work out the difference in the quote from the previous 30 minutes and store it in the diff field

 

 

e.g

 

| 2008-03-17 00:00:00 | 15000 | null/0 |
| 2008-03-17 00:30:00 | 15002 | 2 |
| 2008-03-17 01:00:00 | 15004 | 2 |
..etc.etc

 

can i do this with a stored procedure or something? or should i use a script..? i just need a nudge in the right direction..

 

thanks.

Link to comment
https://forums.phpfreaks.com/topic/97403-noob-needs-help-with-comparing-feilds/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.