Help with database please!! - HotUKDeals
We use cookie files to improve site functionality and personalisation. By continuing to use HUKD, you accept our cookie and privacy policy.
Get the HUKD app free at Google Play

Search Error

An error occurred when searching, please try again!

Login / Sign UpSubmit

Help with database please!!

£0.00 @
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 lib…
ChipSticks Avatar
7y, 11m agoPosted 7 years, 11 months ago
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
ChipSticks Avatar
7y, 11m agoPosted 7 years, 11 months ago
Options

All Comments

(8) Jump to unreadPost a comment
Comments/page:
#1
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
#2
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 :)
#3
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
#4
ChipSticks
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
#5
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
#6
hodsey77 and you getting somewhere with this it seems...destination field... thats the overdue field isn't it?
#7
Xiwt
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
#8
ChipSticks
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

You don't need an account to leave a comment. Just enter your email address. We'll keep it private.

...OR log in with your social account

...OR comment using your social account

Looking for Twitter login?
Thanks for your comment! Keep it up!
We just need to have a quick look and it will be live soon.
The community is happy to hear your opinion! Keep contributing!