how to select different from different tables

  • How to accomplish this:

    Have a tblCurrentWinTrainingLog .

    tblCurrentWinTrainingLog field:

    quiz name

    quiz time

    emplID

    emplinfo

    empid

    ccnumber

    unit

    the quiz will be due after one year the employee take the test which is stored in the  tblCurrentWinTrainingLog. I need to extract the employee who have not take the test

    I have quiz name and due date,ccnumber and unit for the manager to select and pull the dued empl out .

     

  • Where is the Test info stored?  In the QuizLog?

    Sidebar... does you table actually have columns with spaces in the names ?

    I think it would help folks to answer your question if you provided the schema for the tables in the form of create statements and some test data in the form of inserts.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Thanks.

     

    CREATE TABLE [dbo].[tblCurrentWinTrainingLog] (

     [EmplNO] [bigint] NOT NULL ,

     [CTDate] [datetime] NULL ,

     [QuizName] [char] (25) COLLATE Latin1_General_CI_AS NULL ,

     [ModuleName] [char] (25) COLLATE Latin1_General_CI_AS NULL ,

     [Score] [char] (3) COLLATE Latin1_General_CI_AS NULL

    ) ON [PRIMARY]

    GO

    GO

    CREATE TABLE [dbo].[HREMP_adp] (

     [SSN] [nvarchar] (11) COLLATE Latin1_General_CI_AS NULL ,

     [EMPLNO] [nvarchar] (50) COLLATE Latin1_General_CI_AS NULL ,

     [FULL NAME] [nvarchar] (26) COLLATE Latin1_General_CI_AS NULL ,

     [FNAME] [nvarchar] (15) COLLATE Latin1_General_CI_AS NULL ,

     [LNAME] [nvarchar] (26) COLLATE Latin1_General_CI_AS NULL ,

     [MI] [nvarchar] (1) COLLATE Latin1_General_CI_AS NULL ,

     [JOBTITLE] [nvarchar] (26) COLLATE Latin1_General_CI_AS NULL ,

     [EMPSTATUS] [float] NULL ,

     [DOB] [smalldatetime] NULL ,

     [ENTITY] [nvarchar] (4) COLLATE Latin1_General_CI_AS NULL ,

     [CC] [nchar] (15) COLLATE Latin1_General_CI_AS NULL ,

     [CCNAME] [nvarchar] (31) COLLATE Latin1_General_CI_AS NULL ,

     [HIRE_DATE] [smalldatetime] NULL ,

     [PHONE] [nvarchar] (12) COLLATE Latin1_General_CI_AS NULL ,

     [STREET] [nvarchar] (31) COLLATE Latin1_General_CI_AS NULL ,

     [CITY] [nvarchar] (31) COLLATE Latin1_General_CI_AS NULL ,

     [STATE] [nvarchar] (2) COLLATE Latin1_General_CI_AS NULL ,

     [ZIPCODE] [nvarchar] (5) COLLATE Latin1_General_CI_AS NULL ,

     [TERMDATE] [nvarchar] (50) COLLATE Latin1_General_CI_AS NULL

    ) ON [PRIMARY]

    GO

    Here is my table quiz log stores the test info since it need name and employee info. Thanks.

  • That's a good start... got any data we can play with and, like I asked, are the tests stored in the same table as the quizzes?  If so, what marks a test differently from the quiz folks have to take a year later?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • sorry the test and quiz here is the same.

     

    test data are in the quiz log

     12799 8/11/2006 9:05:49 AM Driver Safety              

     101984 7/13/2006 Back Injury Prevention     

     101983 7/13/2006 Back Injury Prevention     

    empinfo table data

    emplID  CC                   unit

    100912  030527100       52

    101549  010206220       42

    072512  030536210       53

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply