Showing posts with label form. Show all posts
Showing posts with label form. Show all posts

Monday, March 19, 2012

Displaying the table owner

Hi,
How can I display the table owner and the table name in
the form of 'tableowner.tablename' from the 'sysobjects'
table. Another words, I want to add the table
owner 'sqlapp' to the table names in my select query.
Thanks for help.You'd be better off using information_Schema views.. try this
select table_schema + '.' + table_name from information_Schema.tables
where table_type = 'base table'
"Rick" <anonymous@.discussions.microsoft.com> wrote in message
news:89e501c3e9be$3a804a10$a001280a@.phx.gbl...
> Hi,
> How can I display the table owner and the table name in
> the form of 'tableowner.tablename' from the 'sysobjects'
> table. Another words, I want to add the table
> owner 'sqlapp' to the table names in my select query.
> Thanks for help.|||I found it Thanks...This was what I needed...
select 'sqlapp.' + name from sysobjects
where xtype = 'U' and name <> 'dt_properties'
>--Original Message--
>You'd be better off using information_Schema views.. try
this
>select table_schema + '.' + table_name from
information_Schema.tables
>where table_type = 'base table'
>"Rick" <anonymous@.discussions.microsoft.com> wrote in
message
>news:89e501c3e9be$3a804a10$a001280a@.phx.gbl...
>> Hi,
>> How can I display the table owner and the table name in
>> the form of 'tableowner.tablename' from the 'sysobjects'
>> table. Another words, I want to add the table
>> owner 'sqlapp' to the table names in my select query.
>> Thanks for help.
>
>.
>

Displaying the table owner

Hi,
How can I display the table owner and the table name in
the form of 'tableowner.tablename' from the 'sysobjects'
table. Another words, I want to add the table
owner 'sqlapp' to the table names in my select query.
Thanks for help.You'd be better off using information_Schema views.. try this
select table_schema + '.' + table_name from information_Schema.tables
where table_type = 'base table'
"Rick" <anonymous@.discussions.microsoft.com> wrote in message
news:89e501c3e9be$3a804a10$a001280a@.phx.gbl...
quote:

> Hi,
> How can I display the table owner and the table name in
> the form of 'tableowner.tablename' from the 'sysobjects'
> table. Another words, I want to add the table
> owner 'sqlapp' to the table names in my select query.
> Thanks for help.
|||I found it Thanks...This was what I needed...
select 'sqlapp.' + name from sysobjects
where xtype = 'U' and name <> 'dt_properties'
quote:

>--Original Message--
>You'd be better off using information_Schema views.. try

this
quote:

>select table_schema + '.' + table_name from

information_Schema.tables
quote:

>where table_type = 'base table'
>"Rick" <anonymous@.discussions.microsoft.com> wrote in

message
quote:

>news:89e501c3e9be$3a804a10$a001280a@.phx.gbl...
>
>.
>

Displaying reports in the form of graphs over web

Hi,

I have a requirement to show reports(in the form of graphs) over the web page. The reports get the data from the database. Right now I'm using GDI+ to render the graphs over the web. I want to know if there are any significant advantages of using sql server reporting services over GDI+ ?

Can I draw any kind of complex graphs using the reporting services or is there a limitation on the kind of graphs that can be drawn?

Does GDI+ have better flexibility in terms of drawing graphs or reporting service can help achieve the same thing?

Thanks much in advance.

Drawing graphs yourself will always provide you with more flexibility than using a pre-built solution. The question is: do you need this much flexibility? In most cases, the answer is no; but only you can answer that. SSRS gives you a lot. I wouldn't dare say it handles every scenario, but I haven't seen a requirement that can't be met with what SSRS provides. If you've ever used the charting in Excel, you can think of this as a somewhat similar feature-set. Honestly, tho, I'd just take the hour to create a simple report. You'll see how easy it is and what options you're given fairly quickly. Additionally, you can check out theAsp.net videos; specifically, the SQL Server 2005 Express section has two videos you might be interested in:#10 Getting Started with Reporting Services and#11 Building and Customizing Reports in Business Intelligence Development Studio.

|||

Thank you so much for the information. I got just what I needed. I need to generate graphs similar to those generated using Excel.

Reporting services seems to be the better option then. Thanks once again.

|||Glad to be able to help! A lot of people hesitate to dig into SSRS because they're worried it'll be complicated. Once you start, tho, you realize just how easy it is to get up and running. Admittedly, SSRS isn't going to solve every problem and there can be some annoying work-arounds when you start to reach more advanced reports, but it's a fantastic 80-90% solution. Best of luck with it!|||

Swetha.c,

I found a solution that has an interface that looks similar to Microsoft Excel. It is a product called AutoTag made by Windward Reports. They have an ASP.NET Engine that can run the reports you generate from AutoTag. Check it out, might be what you are looking for.

http://www.windward.net

--TR

Friday, March 9, 2012

Displaying Encoded Characters

some special characters are saved in an encoded form. However reporting
services does not convert it back to the regular form when it retreives it
from the database, instead it would output get wierd characters.the code for keystrokes ALT 250 and others are whats being outputted not the
correct symbol.
"Marvin" wrote:
> some special characters are saved in an encoded form. However reporting
> services does not convert it back to the regular form when it retreives it
> from the database, instead it would output get wierd characters.

Friday, February 24, 2012

Display Tabular Form from DBCC SHOWCONTIG Command

Dear all,
I want to display information resulted by DBCC SHOWCONTIG Command in
tabular form like below:
(Pages Scanned) (Extents Scanned) (Avg. Pages per Extent)..
TABLE A
TABLE B
TABLE C
...
Is it possible?
Thanks
Robert LieUse the WITH TABLERESULTS option. Actually, if you look in Books Online (upd
ated version), you have
a sample for this.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Robert Lie" <robert.lie24@.gmail.com> wrote in message
news:%23lOMj05VFHA.3864@.TK2MSFTNGP10.phx.gbl...
> Dear all,
> I want to display information resulted by DBCC SHOWCONTIG Command in tabul
ar form like below:
> (Pages Scanned) (Extents Scanned) (Avg. Pages per Extent)..
> TABLE A
> TABLE B
> TABLE C
> ...
> Is it possible?
> Thanks
> Robert Lie

Display Tabular Form from DBCC SHOWCONTIG Command

Dear all,
I want to display information resulted by DBCC SHOWCONTIG Command in
tabular form like below:
(Pages Scanned) (Extents Scanned) (Avg. Pages per Extent)..
TABLE A
TABLE B
TABLE C
...
Is it possible?
Thanks
Robert Lie
Use the WITH TABLERESULTS option. Actually, if you look in Books Online (updated version), you have
a sample for this.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Robert Lie" <robert.lie24@.gmail.com> wrote in message
news:%23lOMj05VFHA.3864@.TK2MSFTNGP10.phx.gbl...
> Dear all,
> I want to display information resulted by DBCC SHOWCONTIG Command in tabular form like below:
> (Pages Scanned) (Extents Scanned) (Avg. Pages per Extent)..
> TABLE A
> TABLE B
> TABLE C
> ...
> Is it possible?
> Thanks
> Robert Lie

Display Tabular Form from DBCC SHOWCONTIG Command

Dear all,
I want to display information resulted by DBCC SHOWCONTIG Command in
tabular form like below:
(Pages Scanned) (Extents Scanned) (Avg. Pages per Extent)..
TABLE A
TABLE B
TABLE C
...
Is it possible?
Thanks
Robert LieUse the WITH TABLERESULTS option. Actually, if you look in Books Online (updated version), you have
a sample for this.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Robert Lie" <robert.lie24@.gmail.com> wrote in message
news:%23lOMj05VFHA.3864@.TK2MSFTNGP10.phx.gbl...
> Dear all,
> I want to display information resulted by DBCC SHOWCONTIG Command in tabular form like below:
> (Pages Scanned) (Extents Scanned) (Avg. Pages per Extent)..
> TABLE A
> TABLE B
> TABLE C
> ...
> Is it possible?
> Thanks
> Robert Lie

Display Rowid in Select of a view with double values

Hi there,
I have the following problem. I would like to add an key to my view in the
form of a rowid. My view displays values that can come more then once.
In Oracle there is one database kolumn called RowId what can be used in any
select statements. Is there also something in SQL Server 2000?
Or what can I do to get the rownumbers? There are no keys in my view and the
values can be come more then once (so nothing is unique.. that's why I need a
nice autonumber number)Alex
SQL Server 2005 has the same function row_number if I remember well
In SQL Server 2000 you can try
SELECT OrderId,(SELECT COUNT(*) FROM Orders O WHERE
O.OrderId<=Orders.Orderid) AS rnk
FROM Orders ORDER BY rnk ASC
"Alex." <Alex@.discussions.microsoft.com> wrote in message
news:228C9AE8-542C-4792-8E64-CDEE7AEE440A@.microsoft.com...
> Hi there,
> I have the following problem. I would like to add an key to my view in the
> form of a rowid. My view displays values that can come more then once.
> In Oracle there is one database kolumn called RowId what can be used in
> any
> select statements. Is there also something in SQL Server 2000?
> Or what can I do to get the rownumbers? There are no keys in my view and
> the
> values can be come more then once (so nothing is unique.. that's why I
> need a
> nice autonumber number)|||There is no such thing as ROWID in SQL 2000.
Also, if a row cannot be uniquely identified then the database is not
correctly normalized. i.e. It is not in 2NF so you are going to find it
difficult to use SQL (which relies on good normalization) to provide a
solution.
--
Nik Marshall-Blank MCSD/MCDBA
"Alex." <Alex@.discussions.microsoft.com> wrote in message
news:228C9AE8-542C-4792-8E64-CDEE7AEE440A@.microsoft.com...
> Hi there,
> I have the following problem. I would like to add an key to my view in the
> form of a rowid. My view displays values that can come more then once.
> In Oracle there is one database kolumn called RowId what can be used in
> any
> select statements. Is there also something in SQL Server 2000?
> Or what can I do to get the rownumbers? There are no keys in my view and
> the
> values can be come more then once (so nothing is unique.. that's why I
> need a
> nice autonumber number)|||Thnks all,
Yes cant do a unique identified the rows.. So I can do use with a temp table
and use an identify column.
"Nik Marshall-Blank (delete fcom for my e" wrote:
> There is no such thing as ROWID in SQL 2000.
> Also, if a row cannot be uniquely identified then the database is not
> correctly normalized. i.e. It is not in 2NF so you are going to find it
> difficult to use SQL (which relies on good normalization) to provide a
> solution.
> --
> Nik Marshall-Blank MCSD/MCDBA
> "Alex." <Alex@.discussions.microsoft.com> wrote in message
> news:228C9AE8-542C-4792-8E64-CDEE7AEE440A@.microsoft.com...
> > Hi there,
> >
> > I have the following problem. I would like to add an key to my view in the
> > form of a rowid. My view displays values that can come more then once.
> >
> > In Oracle there is one database kolumn called RowId what can be used in
> > any
> > select statements. Is there also something in SQL Server 2000?
> >
> > Or what can I do to get the rownumbers? There are no keys in my view and
> > the
> > values can be come more then once (so nothing is unique.. that's why I
> > need a
> > nice autonumber number)
>
>

Sunday, February 19, 2012

Display pictures in Northwind on the VB form

Hi,
In Northwind , there is an employees table which store photos. It seems the
pictures are linked to the picture files because there is a photopath field
containing the path. When I try to display the photos on the VB form, it g
ive me a error. I used the same way to display the logos in the pubs and th
ere is no problem. In VB, I used ODBC data source with ADODB control and a
picture control. Could you try it and tell me how to solve the problem?
Thanks a lotHi
The Photopath column contains the path to the photo. This has a http address
which you may have to change. The logo column in the PUBS database (pub_inf
o table) is an Image datatype which is the same datatype as the photo column
in the Northwind Employee table.
John
"Chrissi" <anubisofthydeath@.hotmail.com> wrote in message news:%23pkBQO0YF
HA.616@.TK2MSFTNGP12.phx.gbl...
Hi,
In Northwind , there is an employees table which store photos. It seems the
pictures are linked to the picture files because there is a photopath field
containing the path. When I try to display the photos on the VB form, it g
ive me a error. I used the same way to display the logos in the pubs and th
ere is no problem. In VB, I used ODBC data source with ADODB control and a
picture control. Could you try it and tell me how to solve the problem?
Thanks a lot|||Could you try to display the photos in VB? I cannot make it work.
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message news:eDDcD44YFHA.3
356@.TK2MSFTNGP15.phx.gbl...
Hi
The Photopath column contains the path to the photo. This has a http address
which you may have to change. The logo column in the PUBS database (pub_inf
o table) is an Image datatype which is the same datatype as the photo column
in the Northwind Employee table.
John
"Chrissi" <anubisofthydeath@.hotmail.com> wrote in message news:%23pkBQO0YF
HA.616@.TK2MSFTNGP12.phx.gbl...
Hi,
In Northwind , there is an employees table which store photos. It seems the
pictures are linked to the picture files because there is a photopath field
containing the path. When I try to display the photos on the VB form, it g
ive me a error. I used the same way to display the logos in the pubs and th
ere is no problem. In VB, I used ODBC data source with ADODB control and a
picture control. Could you try it and tell me how to solve the problem?
Thanks a lot|||Hi Chris
As I don't have VB on a machine I can't, but I am pretty sure that the sampl
e program would work as it has been around for so long!! The code is using t
he photo column which it materialises by writing it to disc and then loads i
t into the Image control. If you stepped through the program you could check
that it wrote the file out correctly and you should be able to test loading
the file into (say) paint.
John
"Chrissi" <anubisofthydeath@.hotmail.com> wrote in message news:ezWN$N5YFHA
.132@.TK2MSFTNGP10.phx.gbl...
Could you try to display the photos in VB? I cannot make it work.
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message news:eDDcD44YFHA.3
356@.TK2MSFTNGP15.phx.gbl...
Hi
The Photopath column contains the path to the photo. This has a http address
which you may have to change. The logo column in the PUBS database (pub_inf
o table) is an Image datatype which is the same datatype as the photo column
in the Northwind Employee table.
John
"Chrissi" <anubisofthydeath@.hotmail.com> wrote in message news:%23pkBQO0YF
HA.616@.TK2MSFTNGP12.phx.gbl...
Hi,
In Northwind , there is an employees table which store photos. It seems the
pictures are linked to the picture files because there is a photopath field
containing the path. When I try to display the photos on the VB form, it g
ive me a error. I used the same way to display the logos in the pubs and th
ere is no problem. In VB, I used ODBC data source with ADODB control and a
picture control. Could you try it and tell me how to solve the problem?
Thanks a lot

Display of SqlDataSource

I'm trying to follow along with lesson07 Web Development Express series and when I drag the SqlDataSource tool onto my form I do not see the object on the screen. I therefore can not configure it until I have placed GridView object onto my form.

I hope you can help me in how to view the SqlDataSource or inform me where I can get further informationThere is a menu option to show/hide the controls which have no display. Sorry, can't think of it off hand, but it's there.|||

Thanks;

I found it under View-Non_Visual Controls

Bruce

Friday, February 17, 2012

Display most recent date?

Hi,
I have a report I need to design which gets it's data form several tables in
my SQL database. There are roughly 2300 records which are displayed but for
some of them there could be people that display more than once, is there
anyway in that instance where I can just get it to bring back the most
recent date i.e
Mrs June Smith 03/04/2004
Mrs June Smith 15/07/2004
Mrs June Smith 12/09/2004 - Just bring back this record.
Is this possible?
Appreciate any help on this.
Thanks
DamonSELECT name, MAX(date)
FROM your_table
GROUP BY name
Jacco Schalkwijk
SQL Server MVP
"Damon" <nonsense@.nononsense.com> wrote in message
news:5YHLd.225$p86.30@.newsfe4-gui.ntli.net...
> Hi,
> I have a report I need to design which gets it's data form several tables
> in
> my SQL database. There are roughly 2300 records which are displayed but
> for
> some of them there could be people that display more than once, is there
> anyway in that instance where I can just get it to bring back the most
> recent date i.e
> Mrs June Smith 03/04/2004
> Mrs June Smith 15/07/2004
> Mrs June Smith 12/09/2004 - Just bring back this record.
> Is this possible?
> Appreciate any help on this.
> Thanks
> Damon
>|||Hi Damon you can use the max function. ie
select max(date),name
from table1
group by name
Tom
"Damon" wrote:

> Hi,
> I have a report I need to design which gets it's data form several tables
in
> my SQL database. There are roughly 2300 records which are displayed but f
or
> some of them there could be people that display more than once, is there
> anyway in that instance where I can just get it to bring back the most
> recent date i.e
> Mrs June Smith 03/04/2004
> Mrs June Smith 15/07/2004
> Mrs June Smith 12/09/2004 - Just bring back this record.
> Is this possible?
> Appreciate any help on this.
> Thanks
> Damon
>
>|||Xref: TK2MSFTNGP08.phx.gbl microsoft.public.sqlserver.programming:503754
Hi,
Thank you for your reply. I can't seem to get it to work as I am
referencing 6 tables for this report. Here is my stored procedure, you will
have to excuse me, am not that proficient @. SQL.
SELECT MAX(dbo.tbl_support.s_contract_startdate) AS Expr1,
dbo.tbl_referral_name.rn_id, dbo.tbl_referral_name.rn_forename,
dbo.tbl_referral_name.rn_surname,
dbo.tbl_referral_add.ra_add1, dbo.tbl_referral_add.ra_add2,
dbo.tbl_support_provider.sp_company,
dbo.tbl_support.s_options,
dbo.tbl_support.s_contract_enddate, dbo.tbl_support.s_review_date,
dbo.tbl_officer.off_full_name
FROM dbo.tbl_referral_name INNER JOIN
dbo.tbl_referral_add ON dbo.tbl_referral_name.rn_id =
dbo.tbl_referral_add.ra_rn_id INNER JOIN
dbo.tbl_referral_info ON dbo.tbl_referral_add.ra_id =
dbo.tbl_referral_info.ri_ra_id INNER JOIN
dbo.tbl_support ON dbo.tbl_referral_info.ri_id =
dbo.tbl_support.s_ri_id INNER JOIN
dbo.tbl_support_provider ON dbo.tbl_support.s_sp_id =
dbo.tbl_support_provider.sp_id INNER JOIN
dbo.tbl_officer ON dbo.tbl_referral_info.ri_off_id =
dbo.tbl_officer.off_id
GROUP BY dbo.tbl_referral_name.rn_id, dbo.tbl_referral_name.rn_forename,
dbo.tbl_referral_name.rn_surname, dbo.tbl_referral_add.ra_add1,
dbo.tbl_referral_add.ra_add2,
dbo.tbl_support_provider.sp_company, dbo.tbl_support.s_options,
dbo.tbl_support.s_contract_startdate,
dbo.tbl_support.s_contract_enddate,
dbo.tbl_support.s_review_date, dbo.tbl_officer.off_full_name
Really appreciate the help.
Damon
"Tom" <Tom@.discussions.microsoft.com> wrote in message
news:928E029A-DE89-4033-A644-CB322E7EBECC@.microsoft.com...
> Hi Damon you can use the max function. ie
> select max(date),name
> from table1
> group by name
>
> Tom
> "Damon" wrote:
>
tables in
for|||You are grouping by tbl_support.s_contract_startdate which is what is
stopping you getting just the MAX date as grouping by will give you a record
for each different value.
I have removed the grouping for you in the code below.
If you find you are still getting too many records, try removing the
grouping for the other dates you have in the select statement and replacing
the selections with MAX also (ie MAX(tbl_support.s_contract_enddate) As
EndDate)
SELECT
MAX(tbl_support.s_contract_startdate) AS StartDate,
tbl_referral_name.rn_id,
tbl_referral_name.rn_forename,
tbl_referral_name.rn_surname,
tbl_referral_add.ra_add1,
tbl_referral_add.ra_add2,
tbl_support_provider.sp_company,
tbl_support.s_options,
tbl_support.s_contract_enddate,
tbl_support.s_review_date,
tbl_officer.off_full_name
FROM tbl_referral_name
INNER JOIN
tbl_referral_add
ON tbl_referral_name.rn_id = tbl_referral_add.ra_rn_id
INNER JOIN
tbl_referral_info
ON tbl_referral_add.ra_id = tbl_referral_info.ri_ra_id
INNER JOIN
tbl_support
ON tbl_referral_info.ri_id = tbl_support.s_ri_id
INNER JOIN
tbl_support_provider
ON tbl_support.s_sp_id = tbl_support_provider.sp_id
INNER JOIN
tbl_officer
ON tbl_referral_info.ri_off_id = tbl_officer.off_id
GROUP BY
tbl_referral_name.rn_id,
tbl_referral_name.rn_forename,
tbl_referral_name.rn_surname,
tbl_referral_add.ra_add1,
tbl_referral_add.ra_add2,
tbl_support_provider.sp_company,
tbl_support.s_options,
tbl_support.s_contract_enddate,
tbl_support.s_review_date,
tbl_officer.off_full_name
Hope this has helped.
Paula
"Damon" wrote:

> Hi,
> I have a report I need to design which gets it's data form several tables
in
> my SQL database. There are roughly 2300 records which are displayed but f
or
> some of them there could be people that display more than once, is there
> anyway in that instance where I can just get it to bring back the most
> recent date i.e
> Mrs June Smith 03/04/2004
> Mrs June Smith 15/07/2004
> Mrs June Smith 12/09/2004 - Just bring back this record.
> Is this possible?
> Appreciate any help on this.
> Thanks
> Damon
>
>|||What can you not get to work? That statement parses fine, and without
further information it is impossible to tell what is wrong with it. See
www.aspfaq.com/5006 for information on how to post a good test scenario.
Jacco Schalkwijk
SQL Server MVP
"Damon" <nonsense@.nononsense.com> wrote in message
news:UKILd.331$p86.195@.newsfe4-gui.ntli.net...
> Hi,
> Thank you for your reply. I can't seem to get it to work as I am
> referencing 6 tables for this report. Here is my stored procedure, you
> will
> have to excuse me, am not that proficient @. SQL.
> SELECT MAX(dbo.tbl_support.s_contract_startdate) AS Expr1,
> dbo.tbl_referral_name.rn_id, dbo.tbl_referral_name.rn_forename,
> dbo.tbl_referral_name.rn_surname,
> dbo.tbl_referral_add.ra_add1, dbo.tbl_referral_add.ra_add2,
> dbo.tbl_support_provider.sp_company,
> dbo.tbl_support.s_options,
> dbo.tbl_support.s_contract_enddate, dbo.tbl_support.s_review_date,
> dbo.tbl_officer.off_full_name
> FROM dbo.tbl_referral_name INNER JOIN
> dbo.tbl_referral_add ON dbo.tbl_referral_name.rn_id =
> dbo.tbl_referral_add.ra_rn_id INNER JOIN
> dbo.tbl_referral_info ON dbo.tbl_referral_add.ra_id =
> dbo.tbl_referral_info.ri_ra_id INNER JOIN
> dbo.tbl_support ON dbo.tbl_referral_info.ri_id =
> dbo.tbl_support.s_ri_id INNER JOIN
> dbo.tbl_support_provider ON dbo.tbl_support.s_sp_id =
> dbo.tbl_support_provider.sp_id INNER JOIN
> dbo.tbl_officer ON dbo.tbl_referral_info.ri_off_id =
> dbo.tbl_officer.off_id
> GROUP BY dbo.tbl_referral_name.rn_id, dbo.tbl_referral_name.rn_forename,
> dbo.tbl_referral_name.rn_surname, dbo.tbl_referral_add.ra_add1,
> dbo.tbl_referral_add.ra_add2,
> dbo.tbl_support_provider.sp_company, dbo.tbl_support.s_options,
> dbo.tbl_support.s_contract_startdate,
> dbo.tbl_support.s_contract_enddate,
> dbo.tbl_support.s_review_date, dbo.tbl_officer.off_full_name
> Really appreciate the help.
> Damon
>
> "Tom" <Tom@.discussions.microsoft.com> wrote in message
> news:928E029A-DE89-4033-A644-CB322E7EBECC@.microsoft.com...
> tables in
> for
>|||Paula you are an absolute star *****. I removed the grouping on the other
dates and included MAX as yyu mentioned and it worked perfectly.
Thank you very much
Damon
"PaulaPompey" <PaulaPompey@.discussions.microsoft.com> wrote in message
news:EB01F9E7-EEA7-4FEC-9DF4-58E242E763A9@.microsoft.com...
> You are grouping by tbl_support.s_contract_startdate which is what is
> stopping you getting just the MAX date as grouping by will give you a
record
> for each different value.
> I have removed the grouping for you in the code below.
> If you find you are still getting too many records, try removing the
> grouping for the other dates you have in the select statement and
replacing
> the selections with MAX also (ie MAX(tbl_support.s_contract_enddate) As
> EndDate)
> SELECT
> MAX(tbl_support.s_contract_startdate) AS StartDate,
> tbl_referral_name.rn_id,
> tbl_referral_name.rn_forename,
> tbl_referral_name.rn_surname,
> tbl_referral_add.ra_add1,
> tbl_referral_add.ra_add2,
> tbl_support_provider.sp_company,
> tbl_support.s_options,
> tbl_support.s_contract_enddate,
> tbl_support.s_review_date,
> tbl_officer.off_full_name
> FROM tbl_referral_name
> INNER JOIN
> tbl_referral_add
> ON tbl_referral_name.rn_id = tbl_referral_add.ra_rn_id
> INNER JOIN
> tbl_referral_info
> ON tbl_referral_add.ra_id = tbl_referral_info.ri_ra_id
> INNER JOIN
> tbl_support
> ON tbl_referral_info.ri_id = tbl_support.s_ri_id
> INNER JOIN
> tbl_support_provider
> ON tbl_support.s_sp_id = tbl_support_provider.sp_id
> INNER JOIN
> tbl_officer
> ON tbl_referral_info.ri_off_id = tbl_officer.off_id
> GROUP BY
> tbl_referral_name.rn_id,
> tbl_referral_name.rn_forename,
> tbl_referral_name.rn_surname,
> tbl_referral_add.ra_add1,
> tbl_referral_add.ra_add2,
> tbl_support_provider.sp_company,
> tbl_support.s_options,
> tbl_support.s_contract_enddate,
> tbl_support.s_review_date,
> tbl_officer.off_full_name
> Hope this has helped.
> Paula
> "Damon" wrote:
>
tables in
for