A simple Question....i think (1 Viewer)

lovely

New member
Local time
Today, 02:21
Joined
Jan 14, 2003
Messages
6
First hello

Its my first post here and first i wanted to say hi....lol

Now...i'm doing a table... and i wanted to do a custom format regarding date type....but i just dunno how :confused:

they have a few types, like general date, small date....and etc

i wanted a date that would be like this :

2002/2003

i tried to insert in the field where it shows "general date" and etc and i did like this

yyyy/yyyy but it doesnt work...help please
 

Jack Cowley

Registered User.
Local time
Today, 02:21
Joined
Aug 7, 2000
Messages
2,639
Access will not recogize 2002/2003 as a date. You can only enter this as a string so you will have to change the Data Type to Text then you can enter 2002/2003. Why do you want to do this? You can always get the Year from any date in Access so what you want to do may be unnecessary. If you can tell us what you want to accomplish someone here will tell you how to do it....

hth,
Jack
 

lovely

New member
Local time
Today, 02:21
Joined
Jan 14, 2003
Messages
6
this is for a exam i'm doing....and the professor is aking us to do a job a team of Rugby....
and this table goes like this:

"information of seasons"

Year: "must assume the form of 2002/2003"
Date of begining: "must not be empty"
Date of end: "must not be empty"
name of coach: "must not be empty"

:confused: my confusion goes on the year thing.



Btw...another question.

THe professor also want me to do several relationships between tables. How do you do relationships between 2 tables with this example:

One atlet(table of atletes) can in several seasons(table of seasons) and one season can have many atlets.

I tought it was one to many...but then i think its many to many... humm i'm confused...really cant figure out this relationships.


Btw...thanks for all the help provided
 

Jack Cowley

Registered User.
Local time
Today, 02:21
Joined
Aug 7, 2000
Messages
2,639
The request for a date field of 2002/2003 is not realistic. Use a standard date field with dates like 1/2/2002. You can, at any time, find the records in the table that include the year 2002 and the year 2003 using a query.

Here is how to set up your tables.... I hope this is not cheating and that your professor will not kill me for helping you!

tblAthlete
AthleteID (Primary key & Autonumber)
LastName
FirstName
...Other Fields....

tblSeason
SeasonID (Primary key and Autonumber)
AthleteID (Foreign key and long integer)
...Other Fields...

The season table will have many seasons and it will also have many athletes but it is still a One to Many relationship.

Good luck with your exam!

Jack
 

lovely

New member
Local time
Today, 02:21
Joined
Jan 14, 2003
Messages
6
the way you do a foreign key...you just need to insert like this?

fk-cod-"name of the other table"

or is it like another way?
 

Jack Cowley

Registered User.
Local time
Today, 02:21
Joined
Aug 7, 2000
Messages
2,639
If you set up your forms with tblAthlete as the Main form and tblSeason as a Subform of the Main form and then link the subform on the AtheleteID the ID number will be added for you automatically in the Subform....

hth,
Jack
 

lovely

New member
Local time
Today, 02:21
Joined
Jan 14, 2003
Messages
6
but i can create a field name with the exact settings as the other one i wank to relationship with doing fk-cod-"name of the other table"

right?
and sorry to bug you m8 :D
 

Jack Cowley

Registered User.
Local time
Today, 02:21
Joined
Aug 7, 2000
Messages
2,639
I am not sure of your question, but you can insert the ID physically as long as the ID exists in the Primary table. The Form/Subform is the preferred method of doing this, but you can do it any way that works for you...

hth,
Jack
 

Users who are viewing this thread

Top Bottom