473,378 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How to generate a report with distinct values

123 100+
Hello,

I have developed Drug Management Software in VB. Now I want to generate one report showing the list of all medicine name, Qty, Expiry Date etc. using Crystal Report.

Format would be like this:

Item Name Batch No. Qty Expiry Date
Crocin B101 100 10/2009
B102 150 9/2007
--------
250

Metacine B201 250 5/2008
B202 170 6/2010
--------
420
I am fetching above details from Purchase Master table. Table can have more than one enteries of same medicine bcoz it can be purchased from more than one supplier at different rate. But I have to restrict the name of Medicine and Batch by displaying only once.

I have written following query but it does not work:
SELECT DISTINCT(ItemName), DISTINCT(BatchNo) FROM PurchaseMst GROUP BY ItemName

Kindly give me solution if u know. I am on final stage of the project but I am stucked.
May 15 '07 #1
2 1625
shidec
26
try this:

SELECT DISTINCT ItemName, BatchNo FROM PurchaseMst
May 15 '07 #2
brazel
11
Good day!

Hello,


Try also this Idea if can give you a help.

If you are using vb crystal report, then try to used formating string set to suppress if duplicated. this command is found if you right click your mouse in the datafield in cystal report. if this is not helpful try this.

Make a table that can store your contents in a master file, I mean is to used two tables 1 table is your master, then the other is the table that can hold only once.

sample logic:

if you save a record to your masterfile then make a extension module the can
save to the second table. and Now let say that the 2nd table have the same files
as what in the masterfile record. then make a decision that can detect if the medicine name or description is already exist, if already exist then thats the time you only used the command "edit" then "update" so no description can be duplicated because you only edited. God Bless and Gud Luck!!!
May 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Yasin | last post by:
Hi I have one reports which shows the Account wise daily transaction during the day.(pl's find below report layout format with column description) May or may not be each account have multiple...
2
by: Simone | last post by:
Hello. I am using the code below: ------------------------------------------- Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Me.Section(0).BackColor = vbWhite Then...
3
by: CSDunn | last post by:
Hello, I have a situation with MS Access 2000 in which I need to display report data in spreadsheet orientation (much like a datasheet view for a form). If you think of the report in terms of what...
3
by: Edward | last post by:
ACCESS 2k I need to design a report based on a rota system for staff at various shops. The data is effectively stored in a single table, along the lines of: Initials (e.g. BH, FG, RM etc.)...
2
by: SJM | last post by:
I have a report that displays records of real estate properties. It is possible for each property to appear a number of times for various reasons. Each record however is unique. What I would like...
6
by: vickie | last post by:
I have a sql server7 database using C#. The system runs fine until the user try to run a report. I get the following error: Object reference not set to an instance of an object. Description: An...
4
by: jason.teen | last post by:
Hi, I am trying to create a table of Query "Metrics" ie. I have many tables in a database which most of the time just counts the number of rows in a certain table, or the number of distinct rows...
6
by: fieldja | last post by:
I have a form called OwnerForm. It contains a combo box called Owner. The combo box looks up names from a table called OwnerName. It contains fields called OwnerID and Owner. I also have a main...
2
by: Coolboy55 | last post by:
I'm creating a report with 3 source queries. Each source query returns distinct values of the same field name (SkillID). How do I display the distinct results of all 3 queries on the same report? ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.