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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.