Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Currency Question 1

Status
Not open for further replies.

Omnillas

Programmer
May 4, 2004
29
US
I have an interesting question posed by peer of how
to select only records from a table that the currency
field has cents. The following table can be considered:
[tt]
ID FName LName Dues_Paid
-- ----- ----- ---------
1 Bob Smith $14.00
2 Susan Allen $12.32
3 Tom Jones $16.87
. . . .
[/tt]
What I would like to see is a selection of only the
records that have non-zero values on the right-side of
the decimal such that the query results would be only
records with ID 2, 3, etc.

Any suggestions? :)
 
something like:

WHERE Mid$([Dues_Paid],1,InStr(1,[Dues_Paid],".")+1) = "00"

Leslie
 
select id, fname, lname, dues_paid
from table
where dues_paid <> int(dues_paid)

John

 
Both were great responses. John's worked correctly for
the question at hand as I failed to mention the affected
datatypes for the field.

Very nice and concise!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top