I.T. Discussion Community!
-Collapse +Expand
Delphi
Search Delphi Group:

Advanced
-Collapse +Expand Delphi To/From
To/FromCODEGuides
-Collapse +Expand Delphi Store
PRESTWOODSTORE

Prestwood eMagazine

October Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyPascal and Delphi Coding BoardDelphi Object PASCAL Topic   Print This     

QReport Query SQL

QReport Query SQL in Delphi Object PASCAL topic (part of our Pascal and Delphi Coding group).

Quick Search: QReport   QReport Query   QReport Query SQL  
Angel
 (Inactive)
England
Now I will readily admit that I aren't the brightest candle in the shop window when it comes to SQL, so I need help (Im looking at you Mr Wehrly!).

My report splits into four groups, each group containing a list of items for that group and their current value. I list my data using QRDBEdits and it works fine. However, I would like to exclude any items where the figure is "0.00". I figure to do this I need a QRExpr instead of the QRDBEdit but I dont know how to make it work properly with the SQL code. In delphi, I would write something like this.

if Currency((Query2.Debit - Query2.Credit)) <> 0 then

but how to do it in Sql???

Answer this for me and Ill get around to sending Mike my picture for the avatars. Im growing my beard as we speak!
 Posted 17 years ago (Thread Starter)
Comment Quote
About Angel -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #7771, 10 replies
Thread Started 10/4/2002 2:31:00 AM
View Counter=2987
Last Reply Posted 10/9/2002 3:13:00 AM)
Location=England  
Joined=18 years ago   MB Posts=199  
Moderator
Mike Prestwood
Prestwood IT
Prestwood IT office in Citrus Heights, CA
I shaved my beard this weekend just for you morons. Yes, I don't have a life!

--
Mike Prestwood
Prestwood IT Solutions

 Posted 17 years ago
Comment Quote
About Mike Prestwood -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About Mike Prestwood

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Web Presence
Facebook, Prestwood IT Facebook page -- fan page. (Visit Me)
Twitter, Follow Prestwood IT on Twitter. (Visit Me)
LinkedIn, Prestwood IT company page on LinkedIn. (Visit Me)
YouTube, Prestwood IT YouTube Channel (Visit My Channel)
Website, My drum website where I sell my drum books. (http://www.play-drums.com)

Post ID #7825 (Level 1.1)  Reply to 7771
Thread Started 10/7/2002 3:33:00 PM
View Counter=2
Location=Prestwood IT office in Citrus Heights, CA 
Joined=19 years ago   MB Posts=1410   KB Posts=1805   KB Comments=70   BLOG, Topics=4  
rt
Castel, -- UK
Now then, is this the time to suggest a dinky seperate little board for report type queries in general as they seem to submerge under all the other questions.

As for the latent bearded Angel's problem (what sex are Angels?) with QRExpr I was forced to get quite into that topic but concluded that QR was a load of sperhicals when they admitted it had some (un)known problems particularly with the group footer type of band. I will have think for wot it is worth ,?. If I were you I would get the firm to lash out and buy something else..

I am currently perceivering with FastREport which has much nicer printing options and will no doubt get around to Report Writer in due course!
rt

Thats enough of that. Ed.

 Posted 17 years ago
Comment Quote
About rt -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About rt

I do like my jazz and blues!


Post ID #7783 (Level 1.2)  Reply to 7771
Reply Posted 10/4/2002 11:51:00 AM
Location=Castel, -- UK 
Joined=19 years ago   MB Posts=687   KB Comments=1  
rt
Castel, -- UK
Well I've thought about it.

If you want to risk it, then send me a report layout and I'll have look, only to probably tell you I can't help. But it is the thought that counts.

Makes you wonder why Borland bundled it with Delphi in the fist place as seems to work only for simpler reports. I don't think it's included V7 is it? Maybe they have realised that, as they say in equestrian circles 'it's no good floggin' a dead 'orse.'

I've also been checking up on Bottechelli's angels and they 'aint got no beards..
rt

Thats enough of that. Ed.

 Posted 17 years ago
Comment Quote
About rt -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About rt

I do like my jazz and blues!


Post ID #7787 (Level 1.3)  Reply to 7771
Reply Posted 10/4/2002 3:46:00 PM
Location=Castel, -- UK 
Joined=19 years ago   MB Posts=687   KB Comments=1  
rt
Castel, -- UK
When you do find the correct site, in addition to beards you will see that Mr Botticelli also gave 'em designer frocks.
rt

Thats enough of that. Ed.

 Posted 17 years ago
Comment Quote
About rt -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About rt

I do like my jazz and blues!


Post ID #7816 (Level 1.4)  Reply to 7771
Reply Posted 10/7/2002 7:54:00 AM
Location=Castel, -- UK 
Joined=19 years ago   MB Posts=687   KB Comments=1  
rt
Castel, -- UK
Bad move. I think you'll need it with winter coming.
rt

Thats enough of that. Ed.

 Posted 17 years ago
Comment Quote
About rt -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About rt

I do like my jazz and blues!


Post ID #7837 (Level 1.5)  Reply to 7771
Reply Posted 10/8/2002 12:22:00 PM
Location=Castel, -- UK 
Joined=19 years ago   MB Posts=687   KB Comments=1  
Angel
 (Inactive)
England
And a gold star goes to Mr Wehrly. Its all so simple when you know how.

As for searching the internet for Botticelli's bearded Angels, I'll have what you two are drinking please.
 Posted 17 years ago (Thread Starter)
Comment Quote
About Angel -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #7810 (Level 1.6)  Reply to 7771
Reply Posted 10/7/2002 3:25:00 AM
Location=England  
Joined=18 years ago   MB Posts=199  
Most Recent Post
Angel
 (Inactive)
England
Hmmm, I wonder whether or not you get nasty cold winters in California. I thought it was hot all year round?

Please bear in mind that I have gleaned this information from the TV show baywatch and not from actual fact!

In fact, I seem to remember that baywatch was pretty much a beard free zone!
 Posted 17 years ago (Thread Starter)
Comment Quote
About Angel -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #7849 (Level 1.7)  Reply to 7771
Reply Posted 10/9/2002 3:13:00 AM
Location=England  
Joined=18 years ago   MB Posts=199  
Scott Wehrly
Prestwood IT
 (Inactive)
Las Vegas, NV USA
whoz dis Mr Wehrly???

I can save you the wait while the beard grows in. Check out "Winston" now...
 Posted 17 years ago
Comment Quote
About Scott Wehrly -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #7780 (Level 1.8)  Reply to 7771
Reply Posted 10/4/2002 9:50:00 AM
Location=Las Vegas, NV USA 
Joined=17 years ago   MB Posts=442   KB Posts=19  
Scott Wehrly
Prestwood IT
 (Inactive)
Las Vegas, NV USA
Okay, getting serious now. Queries...



First off, you should know that my experience with Quick Reports isn't all that great. Having never figured out how to build a successful master/detail report in QR, I have typically given up on it for ReportPrinter Pro or RAVE.



But, to help with your problem...



Well the real simple way to define the query would be like this:



SELECT (DEBIT - CREDIT) AS "OWED"
FROM ACCOUNTS
WHERE (DEBIT - CREDIT) <> 0.0



(The WHERE clause WHERE OWED <> 0.0 wouldn't work because standard SQL doesn't allow column aliases in a WHERE clause.)



If you created a view in your database, and used it for the report, you could assign the calculated column a name, and filter on that column name:



CREATE VIEW Account_Balances
( Owed ) AS
SELECT (DEBIT - CREDIT)
FROM ACCOUNTS



And, in your QRExpr...



SELECT FROM Account_Balances
WHERE Owed <> 0.0



Whenever I have a complex data expression I want to present in a report, if I can define it in SQL, I will use a view.
 Posted 17 years ago
Comment Quote
About Scott Wehrly -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #7782 (Level 1.9)  Reply to 7771
Reply Posted 10/4/2002 10:06:00 AM
Location=Las Vegas, NV USA 
Joined=17 years ago   MB Posts=442   KB Posts=19  
Scott Wehrly
Prestwood IT
 (Inactive)
Las Vegas, NV USA
No, as of Delphi 7 Studio, QR has gone to the glue factory. D7S now comes with RAVE, which is a very nice product from
Old UBB Archived Link: [URL=http://www.nevrona.com]Nevrona Designs[/URL]
.



As for Botticelli, I haven't found any bearded angels in his works, either. But then again, no bulldogs either...
 Posted 17 years ago
Comment Quote
About Scott Wehrly -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #7802 (Level 1.10)  Reply to 7771
Reply Posted 10/6/2002 9:04:00 AM
Location=Las Vegas, NV USA 
Joined=17 years ago   MB Posts=442   KB Posts=19  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1142A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #7771 Counter
2987
Since 4/2/2008

Follow PrestwoodBoards on: 


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech