searching fields and displaying feilds with data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Moose4098
    New Member
    • Aug 2008
    • 1

    searching fields and displaying feilds with data

    He is what i am trying to do. I have a sql server 2005 express and im building a program with VB6. I have a form that people use to enter data into the data base. Its entered by the date, and there is a notes field. What i want to do is get the notes for only days that have notes as not all days in a month would have notes. How can i search through by date and retreive only dates with notes? the best easiest way.
    eg
    fldDate = 01/01/08 fldNotes = "blank"
    fldDate = 01/02/08 fldNotes = "some note here about the day"
    fldDate = 01/03/08 fldNotes = "blank"

    check to see if there is any notes for month of january, 2008 if there is notes unhide view notes button, click on veiw notes button and populates a "whatever would be best" to view all notes on a form.
    IE
    01/02/08 - some note here about the day


    any ideas on this would be greatly appreciated :) thanks in advance
  • Delerna
    Recognized Expert Top Contributor
    • Jan 2008
    • 1134

    #2
    something like this for displaying the notes
    [code=sql]

    create proc prListNotes @Mth int,@Yr int
    as
    select yourfields
    from thetable
    where month(fldDate)= @Mth and year(fldDate)=@ Yr and fldNotes<>'blan k'
    go
    [/code]

    call it from your front end something like this
    Code:
    set recordsetOBJ=conectionOBJ.execuste "EXEC prListNotes 1,2008"
    you would also know to unhide the button by the fact that there are records or not in the recorset object.

    Hope it helps

    Comment

    Working...