How to make table to store reminders

Discussion in 'Databases' started by akshaykalia, Apr 9, 2011.

  1. #1
    Hi,
    I want a table in which i want to store reminders for users
    These are the columns i have in mind for the same

    id {int} Primary Key
    emp_id {int} Foreign Key to employee Table
    reminder {varchar}
    date {Datetime}

    Now i want these reminders to be yearly or quaterly depending upon how the user chooses it.
    Also me want them to be displayed, say, 15days before the date stored.

    So what should my SQL Query look like for the same. ?

    Regards,
    Akshay
     
    akshaykalia, Apr 9, 2011 IP
  2. randheer

    randheer Greenhorn

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #2
    Little more simplified form of you data model.

    Table:
    This will be reminder master table you can a type of reminder and than can use their ID for different table.

    Reminder
    1. ReminderId
    2. Reminder Name
    3. Description
    4. Created Date

    Employee Reminder

    1. Employee ID
    2. EmpReminder ID
    3. ReminderDate

    Master table will reduce the repetition of reminder data. This reminderId can be assigned in employeereminder table

    Getting the data for 15day prior to the reminder data.

    Its in TSQL

    Select employeeID,ReminderName
    From Employee Reminder
    inner join reminder on reminderid= EmpReminder ID
    where reminderdate -15=getdate()

    It will show reminder 15 days before the reminder date

    IT may Help You
     
    randheer, Apr 12, 2011 IP