Re: MakeTable Query -- Field Must be "Double" vs. "Decimal"
From: Allen Browne (AllenBrowne_at_SeeSig.Invalid)
Date: 09/23/04
- Next message: Jeff Boyce: "Re: Grouping a Count of Unique Records - Going Round in Circles :("
- Previous message: RFJ: "Re: Query gives wrong Answer - Repost with requested SQL Code"
- In reply to: Tom: "MakeTable Query -- Field Must be "Double" vs. "Decimal""
- Next in thread: Tom: "Re: MakeTable Query -- Field Must be "Double" vs. "Decimal""
- Reply: Tom: "Re: MakeTable Query -- Field Must be "Double" vs. "Decimal""
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 23 Sep 2004 21:47:32 +0800
Try:
Total: CDbl(Nz([X] * 0.6 + [Y] * 0.4, 0))
That should return a Double type.
You will still need to open your table in design view, and set the Format to
Fixed and the Decimal Places to 3 if you want it displayed that way. (Note
that these settings only affect the way the data is displayed, not how it is
stored.)
-- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Tom" <anynomys@newsgroup.com> wrote in message news:uDD0bHXoEHA.2636@TK2MSFTNGP09.phx.gbl... > In a "MakeTable" query, I use an expression that calculates the following > (sample): > > Total: ([X]*0.6+[Y]*0.4) > > When I execute the query, field "Total" always becomes a "Decimal" data > type. > > Does anyone know how I modify the query to ensure the data type will > always > be "Double" (3 decimals) for field "Total" (once the MakeTable query has > been executed)?
- Next message: Jeff Boyce: "Re: Grouping a Count of Unique Records - Going Round in Circles :("
- Previous message: RFJ: "Re: Query gives wrong Answer - Repost with requested SQL Code"
- In reply to: Tom: "MakeTable Query -- Field Must be "Double" vs. "Decimal""
- Next in thread: Tom: "Re: MakeTable Query -- Field Must be "Double" vs. "Decimal""
- Reply: Tom: "Re: MakeTable Query -- Field Must be "Double" vs. "Decimal""
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|