Groups

    Help with database please!!

    OK, I'm trying to help my daughter with her database homework, and even though I'm doing databases at the moment, I can't work out how to set this up lol.

    She has had to set up a database for a library, to show members loans etc..

    In the table for loans she has a field for overdue books, one field for 'Date Due Back' and the next with 'Overdue?' she needs to set it up so as soon as the date its due back passes the overdue bit says YES.

    Does that make sense? is it possible?

    I know you guys are smart! lol any help is appreciated


    xx

    8 Comments

    I'm not smart but will try and help.

    "In the table for loans she has a field for overdue books, one field for 'Date Due Back' and the next with 'Overdue?' she needs to set it up so as soon as the date its due back passes the overdue bit says YES.

    Does that make sense? is it possible?"

    What are you coding in?

    From my understanding this is your pseudo code...

    If 'Date' > or = 'Date Due Back'

    then 'Overdue' = True

    else 'Overdue' = False

    She needs to create an Update Query, which checks the date in the DateDueBack field to see if it is greater than today's date, and if it is, to update the Overdue? field to "YES"

    i.e.

    Design a new Query, and change to the SQL view, and enter something like this:

    UPDATE Loans SET Loans.Overdue? = "YES"
    WHERE (((Loans.DateDueBack)
    (where Loans is the name of the table, and Overdue? the overdue field, and DateDueBack the date field. If you have spaces in the names, either take them out (better), or enclose in [Square Brackets] )

    You would need to set this up to run either when you first open the DB, or something....

    This is just to make things say they are overdue... you then need another update query to say NO if they are not overdue (or no-longer overdue)..... hope this makes sense

    Original Poster

    god this is getting harder and harder lol.

    I'm not sure if this is going to work, is doing the SQL thing the only way to do this? they haven't done that at school and she needs to understand what she's doing as she has to evaluate it. I just showed her your reply and she said "huh?" lol

    ChipSticks;4455728

    god this is getting harder and harder lol.I'm not sure if this is going … god this is getting harder and harder lol.I'm not sure if this is going to work, is doing the SQL thing the only way to do this? they haven't done that at school and she needs to understand what she's doing as she has to evaluate it. I just showed her your reply and she said "huh?" lol



    If you type the SQL in, you can then change back to the design view... just easier to tell you it that way...

    I'll take a piccy of the design view if you like?

    http://i219.photobucket.com/albums/cc320/hodsey77/dbupdatequery.jpg

    Original Poster

    Ok, she'd added in the
    hers has

    Field
    table
    sort
    show
    criteria
    or

    ?

    Sorry scratch that. lolol


    Ok I've done what you said and when she runs it says

    Query must have at least one destination field

    ?

    arghhhh someone get me vodka!! lol

    hodsey77 and you getting somewhere with this it seems...destination field... thats the overdue field isn't it?

    Original Poster

    Xiwt;4456154

    hodsey77 and you getting somewhere with this it seems...destination … hodsey77 and you getting somewhere with this it seems...destination field... thats the overdue field isn't it?



    I don't know what it is, but that query won't work lol

    ChipSticks;4455980
    Ok, she'd added in the
    hers has

    Field
    table
    sort
    show
    criteria
    or

    ?

    Sorry scratch that. lolol


    Ok I've done what you said and when she runs it says

    Query must have at least one destination field

    ?

    arghhhh someone get me vodka!! lol


    Did you manage to get it sorted? The bit in red at the top, makes the bit in red at the bottom appear - you have to choose the Update Query option.
    Post a comment
    Avatar
    @
      Text
      Top Discussions
      1. 'Hard' Brexit offers '£135bn annual boost' to economy - BBC News1846
      2. Surprise! The HUKD Summer Flamedeer Hunt 2017 **OFFICIAL THREAD** (trading …182466
      3. Any PS4 News Here29213642
      4. How dangerous is Donald trump?34226

      See more discussions