Click here to Skip to main content
15,902,492 members
Home / Discussions / Database
   

Database

 
GeneralRe: Problem with stored procedure.... Pin
Kasic Slobodan8-Dec-06 9:22
Kasic Slobodan8-Dec-06 9:22 
GeneralRe: Problem with stored procedure.... Pin
alexrad8-Dec-06 9:40
alexrad8-Dec-06 9:40 
GeneralRe: Problem with stored procedure.... Pin
Kasic Slobodan8-Dec-06 9:53
Kasic Slobodan8-Dec-06 9:53 
AnswerRe: Problem with stored procedure.... [modified] Pin
Kasic Slobodan8-Dec-06 11:46
Kasic Slobodan8-Dec-06 11:46 
QuestionRetraiving Table Infromation from MS Access Pin
Viral Upadhyay8-Dec-06 0:16
Viral Upadhyay8-Dec-06 0:16 
AnswerRe: Retraiving Table Infromation from MS Access Pin
NileshUpadhyay11-Dec-06 22:34
NileshUpadhyay11-Dec-06 22:34 
QuestionAutomatic update Pin
kkadir7-Dec-06 22:52
kkadir7-Dec-06 22:52 
AnswerRe: Automatic update Pin
Michael Potter8-Dec-06 5:28
Michael Potter8-Dec-06 5:28 
This is better handled with a VIEW. I very rarely store duplicated or calculated data in a table. I only violate this rule when a frequently run query would be greatly enhanced. In psuedo-code on SQL Server it would look something like this:
CREATE VIEW FirmOpen
AS
    SELECT
        FirmName,
        CASE
            GETDATE() BETWEEN OpenTime AND CloseTime THEN 1
            ELSE 0
        END AS IsOpen
    FROM 
        tblFirm
    INNER JOIN
        tblTime
        ON (tblFirm.FirmName = tblTime.FirmName)

You will need to modify the INNER JOIN to reflect your foreign keys and handle the Date/Time calculations correctly. Once complete, you can use the FirmOpen like any other table (except in the case of UPDATE/INSERT).

If you still want to field to update automatically, you will need tocreate a SQL Job that does the UPDATE and schedule it to run every minute (poor choice in my opinion).
Questionquery for retrieving Pin
Ravi Shankar437-Dec-06 20:03
Ravi Shankar437-Dec-06 20:03 
AnswerRe: query for retrieving Pin
praveen26608-Dec-06 1:03
praveen26608-Dec-06 1:03 
GeneralRe: query for retrieving Pin
praveen26608-Dec-06 1:04
praveen26608-Dec-06 1:04 
Questionwant to get only one row(first one) when multiple rows are present in a table..... Pin
Khawar Abbas17-Dec-06 20:01
Khawar Abbas17-Dec-06 20:01 
AnswerRe: want to get only one row(first one) when multiple rows are present in a table..... Pin
Colin Angus Mackay7-Dec-06 22:52
Colin Angus Mackay7-Dec-06 22:52 
GeneralRe: want to get only one row(first one) when multiple rows are present in a table..... Pin
Khawar Abbas17-Dec-06 23:36
Khawar Abbas17-Dec-06 23:36 
GeneralRe: want to get only one row(first one) when multiple rows are present in a table..... Pin
RSArockiam8-Dec-06 1:12
RSArockiam8-Dec-06 1:12 
QuestionDatabase Table Design Pin
Tomy14027-Dec-06 15:53
Tomy14027-Dec-06 15:53 
AnswerRe: Database Table Design Pin
Colin Angus Mackay7-Dec-06 22:48
Colin Angus Mackay7-Dec-06 22:48 
GeneralRe: Database Table Design Pin
karam chandrabose8-Dec-06 5:16
karam chandrabose8-Dec-06 5:16 
GeneralRe: Database Table Design Pin
Colin Angus Mackay8-Dec-06 6:05
Colin Angus Mackay8-Dec-06 6:05 
GeneralRe: Database Table Design Pin
Tomy140220-Dec-06 15:46
Tomy140220-Dec-06 15:46 
QuestionRound up/down minutes to next quater Pin
VK-Cadec7-Dec-06 10:08
VK-Cadec7-Dec-06 10:08 
AnswerRe: Round up/down minutes to next quater Pin
Eric Dahlvang8-Dec-06 3:20
Eric Dahlvang8-Dec-06 3:20 
QuestionPopulating datas from sql db and displaying them in .CSV File Format Pin
vijay_837-Dec-06 7:01
vijay_837-Dec-06 7:01 
QuestionWorking with MDF file Pin
R.Palanivel7-Dec-06 3:04
R.Palanivel7-Dec-06 3:04 
AnswerRe: Working with MDF file Pin
Colin Angus Mackay7-Dec-06 3:30
Colin Angus Mackay7-Dec-06 3:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.