Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default last date

    i have a databe set up that holds contact info, as well as notes on each contact
    the notes are added and the date is captured to the database table

    2 separate questions

    1) if each contact has say 5 notes is it possible to pull from that table
    of notes the last date a note was added for a customer?

    2) also is it possible to display contacts in another datagrid that shows
    only those contacts that have not
    had a note added in say 30 days?

    acidrain9 Guest

  2. Similar Questions and Discussions

    1. JSObject returns wrong date. How can Iextract correct date from digital signature?
      I'm trying to extract name and date from digital signatures by using JSObject in Excel VBA, but JSObject returns wrong date. Year, month, hour and...
    2. #39245 [NEW]: date function generate wrong date with 1162083600 timestamp
      From: lohner at aldea dot hu Operating system: Linux PHP version: 5.1.6 PHP Bug Type: Date/time related Bug description: ...
    3. converting date into database date format(newbie)
      Hi! U can convert "8-Aug-03" into mysql date which requires yyyy-mm-dd format as below. <?php date("Y-m-d",strtotime("8-Aug-03")); ?>
    4. How do I manipulate a date variable to a specific date array?
      Hi, I use the getdate() function to return today's date in an array. I do this as I need to separate the day/month/year as to display them in a...
  3. #2

    Default Re: last date

    .oO(acidrain9)
    >i have a databe set up that holds contact info, as well as notes on each contact
    > the notes are added and the date is captured to the database table
    >
    > 2 separate questions
    >
    > 1) if each contact has say 5 notes is it possible to pull from that table
    >of notes the last date a note was added for a customer?
    >
    > 2) also is it possible to display contacts in another datagrid that shows
    >only those contacts that have not
    > had a note added in say 30 days?
    Both can be done, but it depends on your table structure and what
    informations are available from them (date etc.). You should have at
    least two tables, one for the contacts, another for the notes. Then it
    should be pretty easy to get the informations you want in 1) and 2).

    Micha
    Michael Fesser Guest

  4. #3

    Default Re: last date

    i do have 2 tables set up, here is the structure:

    TBL_CONTACTS
    ID
    Name
    PhoneNumber
    NoteID

    TBL_NOTES
    NoteID
    NoteDate
    Note

    i added the NoteDate field to the datagrid but it displays each contact more
    than once if it has multiple notes
    how do i get it to capture only the most current date and not all of them....

    then how can i set up a datgrid to dislay contacts that have not had a note
    added to them in say 30 days

    acidrain9 Guest

  5. #4

    Default Re: last date

    You could have just used the contact ID in the notes table....
    But -
    If you just want the date of the last note:
    SELECT C.ID, C.Name, C.PhoneNumber, (SELECT MAX(N.NoteDate) FROM TBL_NOTES N
    WHERE N.NoteID=C.ID)
    FROM TBL_CONTACTS C
    ORDER BY C.Name

    To show contacts with no recent notes:
    SELECT ID, Name, PhoneNumber
    FROM TBL_CONTACTS
    WHERE NoteID NOT IN (SELECT NoteID FROM TBL_NOTES WHERE NoteDate >=
    DATEADD(d,-30,GETDATE())
    ORDER BY Name

    "acidrain9" <webforumsuser@macromedia.com> wrote in message
    news:cvvse8$9s8$1@forums.macromedia.com...
    > i do have 2 tables set up, here is the structure:
    >
    > TBL_CONTACTS
    > ID
    > Name
    > PhoneNumber
    > NoteID
    >
    > TBL_NOTES
    > NoteID
    > NoteDate
    > Note
    >
    > i added the NoteDate field to the datagrid but it displays each contact
    more
    > than once if it has multiple notes
    > how do i get it to capture only the most current date and not all of
    them....
    >
    > then how can i set up a datgrid to dislay contacts that have not had a
    note
    > added to them in say 30 days
    >

    CMBergin Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139