Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > Calculated Fields < Suppress | Arrange Tabular >
Back to Calculated Fields    Comments List
Upload Images   Link   Email  
text or number
Lyle Bailey 
       
11 months ago
for a query field
Expr1: Nz(DSum("[HOURSEARNED]","T-HOURS-EDUCATION-01","DATEEARNED>=Date()-30"),0)
output expr1=1
Expr2: Nz(DSum("[HOURSEARNED]","T-HOURS-EDUCATION-02","DATEEARNED>=Date()-30"),0)
output expr2=2
does this return number or short text?
tried adding expr1+expr2 it doesn't add it, it concatenates, IE. 1+2 = 3 but when I run the query it gives 12 like it was expr1 & expr2
Sami Shamma 
             
11 months ago
Did you try to convert it to an integer with "CINT"?
Richard Rost 
          
11 months ago
It's going to return whatever data type the original field is (technically a variant) so like Sami said you may need to cast it into an Int or Lng.
Lyle Bailey OP 
       
11 months ago
thank you cint worked
when i created the table hoursearned was int
ran this Expr1: Nz(DSum("[HOURSEARNED]","T-HOURS-EDUCATION-01","DATEEARNED>=Date()-30"),0)
output expr1=1
it converted it into short text.
so, I did exprc1: cint ([expr1]) any way to cint on expr1?
Richard Rost 
          
11 months ago
Just put the whole thing together:

Expr1: CLNG(Nz(DSum("[HOURSEARNED]","T-HOURS-EDUCATION-01","DATEEARNED>=Date()-30"),0))

I prefer CLNG to CINT if there's any way your value will go over 32,000.
Lyle Bailey OP 
       
11 months ago
thank you I LOVE YOU
Richard Rost 
          
11 months ago

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Calculated Fields.
 

 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 2/15/2025 12:32:28 PM. PLT: 1s