complete newbie maths int function

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hello I,m a complete newbie to this.
In MyTable the ID is an integer which represents a group of people
 and a fractional part which indicates  a person in that group. e.g.
 ID             Forename        Surname
10.01         John                Doe
10.02         Mary               Baker
10.03         Baby                Doe
1061.01     Jane                 Brown
1061.02     William            Brown
1061.03    Joseph              Smith
I've been using ms access and to get all members of a group I used:
SELECT * FROM MyTable WHERE surname = "Doe" AND INT(ID) = 10
(this just part of a much longer statement)
Basically I want to select all people with surname Doe in group ten (in this
particular case)
Moving to MySql I find that INT has a different meaning.
I looked at all the different functions and I'm at a loss
as to how to implement the above
Help Please
Best Regards

Re: complete newbie maths int function

Quoted text here. Click to load it

FLOOR is a function that returns the integer portion of a real number.

Though I would ask if you're considering separating the value into two
columns now that you use a database that supports a multi-column primary
key.  That would make it so that you don't have to do any calculation to get
the group portion of your value.

Bill K.

Re: complete newbie maths int function

Thanks very much Bill for your help.
Yes I've been considering using a separate field for person_in_group_id but
I have many separate (msaccess) databases with just one table (my data only
uses a relational db so that I can use sql to extract data).
however I need to carefully consider how I can use UPDATE  from an exported
msaccess file to create an extra field.
I wish I hadn't taken the 'easy route' when I began this project :-))
Once again thanks very much for your help.
Very Best Regards

Site Timeline