Showing posts with label instead. Show all posts
Showing posts with label instead. Show all posts

Tuesday, March 20, 2012

Bug? Available Values list for boolean parameters

Hi,
I have defined a boolean parameter in my report and I wish to display a list
of possible values instead of the True/False radio button. I have defined
two possible values in the Available Values list (Report Parameters Window)
but it looks as though they are ignored, the parameter toolbar still
displaying the True/False radio buttons...
Hope someone can help.Looks like a bug to me...best chance is to programatically create your
own parameter page.
"webfrog" <webfrog@.discussions.microsoft.com> wrote in message news:<11B5246A-F6E6-4583-8945-A945851F58CD@.microsoft.com>...
> Hi,
> I have defined a boolean parameter in my report and I wish to display a list
> of possible values instead of the True/False radio button. I have defined
> two possible values in the Available Values list (Report Parameters Window)
> but it looks as though they are ignored, the parameter toolbar still
> displaying the True/False radio buttons...
> Hope someone can help.|||If you change your datatype to integer, then put in available values such
that true = 1 and false = 0, you will get a drop-down list with true & false
options.
"webfrog" wrote:
> Hi,
> I have defined a boolean parameter in my report and I wish to display a list
> of possible values instead of the True/False radio button. I have defined
> two possible values in the Available Values list (Report Parameters Window)
> but it looks as though they are ignored, the parameter toolbar still
> displaying the True/False radio buttons...
> Hope someone can help.
>

Monday, March 19, 2012

Bug, Can not create varchar(max) columns with SMO

I just want to create a varchar(max) column with SMO. My code is as follows. Instead of varchar(max), a column with datatype varchar(1) is created!!!

Table t = new Table(db, "t1");
t.Columns.Add(new Column(t, "c1", new DataType(SqlDataType.NVarCharMax)));
t.Alter();

That seems to be a bug of release version. I don't face this problem in Beta 2

Is there a workaround for that problemThis seems like bug to me also. I will file a bug against the product. As a workaround, you can execute the T-SQL directly, such as

db.ExecuteNonQuery("create table tb (id nvarchar(max))");

Peter

|||Thanks for your help.|||Just ran across the same issue. Any other workaround on this?|||Hi

I just encountered the same issue with Sql Server 2005 SP1. However, it has only happened on one computer. The problem is not reproducible on any other machines in our environment.|||YOu should doublecheck that again, as in SP2 the following script is returned from the Scripter:

Code Snippet

USE [Northwind]

ALTER TABLE [dbo].[t1] ADD [c1] [nvarchar](max)

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||The SMO library is invoked on a server that does not have Sql Server. The only Sql Server related libraries installed on the server are as follows.

XMO 9.00.1399.06 NOV 2005 Feature Pack
NATIVE CLIENT 9.00.1399.06 NOV 2005 Feature Pack
XML6.0 6.00.3890.0 NOV 2005 Feature Pack

Are there known issues with using these versions?

Thanks|||The SMO libraries are also updated within the service packs, so it could be that the actual stack which is generating the ALTER statement was bug fixed. I posted a bug before RTM time, which was also fixed with SP1, so there can be a good chance that the version you are using 1399 = RTM has the bug which is causing the problems.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Actually, you can set it - it's just a bit "hidden". Set the DataType to NVarChar and set an arbitrary length value (like 100). Then set the column's DataType.MaximumLength property to -1. It is now a NVarChar(max) column.

|||Thanks

I resolved the problem by upgrading the Sql Server Management Objects from the Nov 2005 release to the Feb 2007 release.

Bug, Can not create varchar(max) columns with SMO

I just want to create a varchar(max) column with SMO. My code is as follows. Instead of varchar(max), a column with datatype varchar(1) is created!!!

Table t = new Table(db, "t1");
t.Columns.Add(new Column(t, "c1", new DataType(SqlDataType.NVarCharMax)));
t.Alter();

That seems to be a bug of release version. I don't face this problem in Beta 2

Is there a workaround for that problem
This seems like bug to me also. I will file a bug against the product. As a workaround, you can execute the T-SQL directly, such as

db.ExecuteNonQuery("create table tb (id nvarchar(max))");

Peter

|||Thanks for your help.|||Just ran across the same issue. Any other workaround on this?|||Hi

I just encountered the same issue with Sql Server 2005 SP1. However, it has only happened on one computer. The problem is not reproducible on any other machines in our environment.

|||YOu should doublecheck that again, as in SP2 the following script is returned from the Scripter:

Code Snippet

USE [Northwind]

ALTER TABLE [dbo].[t1] ADD [c1] [nvarchar](max)

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||The SMO library is invoked on a server that does not have Sql Server. The only Sql Server related libraries installed on the server are as follows.

XMO 9.00.1399.06 NOV 2005 Feature Pack
NATIVE CLIENT 9.00.1399.06 NOV 2005 Feature Pack
XML6.0 6.00.3890.0 NOV 2005 Feature Pack

Are there known issues with using these versions?

Thanks
|||The SMO libraries are also updated within the service packs, so it could be that the actual stack which is generating the ALTER statement was bug fixed. I posted a bug before RTM time, which was also fixed with SP1, so there can be a good chance that the version you are using 1399 = RTM has the bug which is causing the problems.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Actually, you can set it - it's just a bit "hidden". Set the DataType to NVarChar and set an arbitrary length value (like 100). Then set the column's DataType.MaximumLength property to -1. It is now a NVarChar(max) column.

|||Thanks

I resolved the problem by upgrading the Sql Server Management Objects from the Nov 2005 release to the Feb 2007 release.

Bug, Can not create varchar(max) columns with SMO

I just want to create a varchar(max) column with SMO. My code is as follows. Instead of varchar(max), a column with datatype varchar(1) is created!!!

Table t = new Table(db, "t1");
t.Columns.Add(new Column(t, "c1", new DataType(SqlDataType.NVarCharMax)));
t.Alter();

That seems to be a bug of release version. I don't face this problem in Beta 2

Is there a workaround for that problem
This seems like bug to me also. I will file a bug against the product. As a workaround, you can execute the T-SQL directly, such as

db.ExecuteNonQuery("create table tb (id nvarchar(max))");

Peter

|||Thanks for your help.|||Just ran across the same issue. Any other workaround on this?|||Hi

I just encountered the same issue with Sql Server 2005 SP1. However, it has only happened on one computer. The problem is not reproducible on any other machines in our environment.

|||YOu should doublecheck that again, as in SP2 the following script is returned from the Scripter:

Code Snippet

USE [Northwind]

ALTER TABLE [dbo].[t1] ADD [c1] [nvarchar](max)

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||The SMO library is invoked on a server that does not have Sql Server. The only Sql Server related libraries installed on the server are as follows.

XMO 9.00.1399.06 NOV 2005 Feature Pack
NATIVE CLIENT 9.00.1399.06 NOV 2005 Feature Pack
XML6.0 6.00.3890.0 NOV 2005 Feature Pack

Are there known issues with using these versions?

Thanks
|||The SMO libraries are also updated within the service packs, so it could be that the actual stack which is generating the ALTER statement was bug fixed. I posted a bug before RTM time, which was also fixed with SP1, so there can be a good chance that the version you are using 1399 = RTM has the bug which is causing the problems.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Actually, you can set it - it's just a bit "hidden". Set the DataType to NVarChar and set an arbitrary length value (like 100). Then set the column's DataType.MaximumLength property to -1. It is now a NVarChar(max) column.

|||Thanks

I resolved the problem by upgrading the Sql Server Management Objects from the Nov 2005 release to the Feb 2007 release.

BUG with Join hints

I am having problems with doing what seams to be a very easy query. For some reason the SQL Server is trying to do nested loops instead of hash join. I tried to force the use of the hash join using the join hint.

Query 1

select *
from DIM_DATE DD
inner hash join (
select A.student_key,
CONVERT(int, CONVERT(varchar, COALESCE (A.date_withdrawn, getdate()), 112)) AS date_withdrawn_current
FROM FACT_STUDENT AS A
) SSE on DD.date_key= date_withdrawn_current


This query gives an error:

Msg 8622, Level 16, State 1, Line 1
Query processor could not produce a query plan because of the hints defined in this query. Resubmit the query without specifying any hints and without using SET FORCEPLAN

Second query is not really what I want but it illustrate that it works fine when getdate() is not used.

Query 2

select *
from DIM_DATE DD
inner hash join (
select A.student_key,
CONVERT(int, CONVERT(varchar, COALESCE (A.date_withdrawn, A.date_enrolled), 112)) AS date_withdrawn_current
FROM FACT_STUDENT AS A
) SSE on DD.date_key= date_withdrawn_current


Is there some problem with using function getdate() ? It works fine in SQL Server 2000

This problem occurs on the SQL Server 2005 SP2 ( 9.00.3050.00 (X64) )
and (9.00.2050)

This problem has to do with some subtle differences between the way SQL Server 2000 handles non-deterministic functions and the way SQL Server 2005 handles it. You can get around it by rewriting your query as follows:

Workaround

with CurrentDate(d) AS (select getdate() d)

select *

from DIM_DATE DD

inner hash join (

select A.student_key,

CONVERT(int, CONVERT(varchar, COALESCE(A.date_withdrawn, (select d from CurrentDate)), 112)) AS date_withdrawn_current

FROM FACT_STUDENT AS A

) SSE on DD.date_key= date_withdrawn_current

Hope that helps.

|||Thanks.

The workaround worked. Finally the query behaves the way it is supposed to. Instead of running for hours it finishes in 12 seconds.

I thought that it has something to do with non deterministic nature of the getdate() but still not sure why would it matter in this case. This is the probe of the hash join, it needs to be scanned only once anyway.

Would that be fixed in SP3 or it works like that by design?
|||

I'm glad that worked. We're digging into it further in the query optimizer team to see why exactly the original query failed. I personally doubt that this will change in SP3 (the risk of changing plans in a service pack is too great) but hopefully we will fix this in future releases.

Thanks for the feedback.

Bug report RS with SP1

Microsoft gang,
I have the following query. if I use @.Shipping instead of @.CustomerShipTo as
a parameter name, at the preview stage, I receive @.StartDate not defined
error.
SELECT
ProductType,Product,
SUM(TotalCases) as TotalCases,
UnitofMeasure,
DatePart(yyyy, DDate) as YDate,
DateName(mm,DDate) as MDate
FROM
fn_CreateBlankSalesCases(@.StartDate,@.EndDate,@.Broker,@.Customer,@.CustomerShip
To)
GROUP BY ProductType,Product,UnitofMeasure,DDate
Regards,
CemSome more information about the parameter bug.
When I add the parameter manually (Report > Report Parameters), the query
below blows at run time, works perfect at query designer.
The way I get around this problem was to define the parameter in the result
query first. The moment I add it to the function below, it shows up in
report parameters. After configuration works perfect.
/*Main query*/
SELECT
ProductType,Product,
SUM(TotalCases) as TotalCases,
UnitofMeasure,
DatePart(yyyy, DDate) as YDate,
DateName(mm,DDate) as MDate
FROM
fn_CreateBlankSalesCases(@.StartDate,@.EndDate,@.Broker,@.Customer,@.CustomerShip
,@.BrandName,@.CanSize)
GROUP BY ProductType,Product,UnitofMeasure,DDate
/*Parameter query*/
SELECT DISTINCT CanSize, CanSize as CanSizeDisplay FROM fn_CreateCanList()
UNION
SELECT Null , '--Select All--'
Regards,
Cem
"Cem Demircioglu" <cem@.NoSpamPlease.com> wrote in message
news:%23VP2%23ZmeEHA.2812@.tk2msftngp13.phx.gbl...
>
> Microsoft gang,
> I have the following query. if I use @.Shipping instead of @.CustomerShipTo
as
> a parameter name, at the preview stage, I receive @.StartDate not defined
> error.
> SELECT
> ProductType,Product,
> SUM(TotalCases) as TotalCases,
> UnitofMeasure,
> DatePart(yyyy, DDate) as YDate,
> DateName(mm,DDate) as MDate
> FROM
>
fn_CreateBlankSalesCases(@.StartDate,@.EndDate,@.Broker,@.Customer,@.CustomerShip
> To)
> GROUP BY ProductType,Product,UnitofMeasure,DDate
> Regards,
> Cem
>|||Thanks. We'll take a look and see if we can repro here.
--
Brian Welcker
Group Program Manager
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Cem Demircioglu" <cem@.NoSpamPlease.com> wrote in message
news:uNgnLbhfEHA.2848@.TK2MSFTNGP10.phx.gbl...
>
> Some more information about the parameter bug.
> When I add the parameter manually (Report > Report Parameters), the query
> below blows at run time, works perfect at query designer.
> The way I get around this problem was to define the parameter in the
> result
> query first. The moment I add it to the function below, it shows up in
> report parameters. After configuration works perfect.
> /*Main query*/
> SELECT
> ProductType,Product,
> SUM(TotalCases) as TotalCases,
> UnitofMeasure,
> DatePart(yyyy, DDate) as YDate,
> DateName(mm,DDate) as MDate
> FROM
> fn_CreateBlankSalesCases(@.StartDate,@.EndDate,@.Broker,@.Customer,@.CustomerShip
> ,@.BrandName,@.CanSize)
> GROUP BY ProductType,Product,UnitofMeasure,DDate
> /*Parameter query*/
> SELECT DISTINCT CanSize, CanSize as CanSizeDisplay FROM
> fn_CreateCanList()
> UNION
> SELECT Null , '--Select All--'
> Regards,
> Cem
> "Cem Demircioglu" <cem@.NoSpamPlease.com> wrote in message
> news:%23VP2%23ZmeEHA.2812@.tk2msftngp13.phx.gbl...
>>
>> Microsoft gang,
>> I have the following query. if I use @.Shipping instead of @.CustomerShipTo
> as
>> a parameter name, at the preview stage, I receive @.StartDate not defined
>> error.
>> SELECT
>> ProductType,Product,
>> SUM(TotalCases) as TotalCases,
>> UnitofMeasure,
>> DatePart(yyyy, DDate) as YDate,
>> DateName(mm,DDate) as MDate
>> FROM
> fn_CreateBlankSalesCases(@.StartDate,@.EndDate,@.Broker,@.Customer,@.CustomerShip
>> To)
>> GROUP BY ProductType,Product,UnitofMeasure,DDate
>> Regards,
>> Cem
>>
>|||Could you send me definitions of your functions fn_CreateBlankSalesCases and
fn_CreateCanList?
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Cem Demircioglu" <cem@.NoSpamPlease.com> wrote in message
news:uNgnLbhfEHA.2848@.TK2MSFTNGP10.phx.gbl...
>
> Some more information about the parameter bug.
> When I add the parameter manually (Report > Report Parameters), the query
> below blows at run time, works perfect at query designer.
> The way I get around this problem was to define the parameter in the
> result
> query first. The moment I add it to the function below, it shows up in
> report parameters. After configuration works perfect.
> /*Main query*/
> SELECT
> ProductType,Product,
> SUM(TotalCases) as TotalCases,
> UnitofMeasure,
> DatePart(yyyy, DDate) as YDate,
> DateName(mm,DDate) as MDate
> FROM
> fn_CreateBlankSalesCases(@.StartDate,@.EndDate,@.Broker,@.Customer,@.CustomerShip
> ,@.BrandName,@.CanSize)
> GROUP BY ProductType,Product,UnitofMeasure,DDate
> /*Parameter query*/
> SELECT DISTINCT CanSize, CanSize as CanSizeDisplay FROM
> fn_CreateCanList()
> UNION
> SELECT Null , '--Select All--'
> Regards,
> Cem
> "Cem Demircioglu" <cem@.NoSpamPlease.com> wrote in message
> news:%23VP2%23ZmeEHA.2812@.tk2msftngp13.phx.gbl...
>>
>> Microsoft gang,
>> I have the following query. if I use @.Shipping instead of @.CustomerShipTo
> as
>> a parameter name, at the preview stage, I receive @.StartDate not defined
>> error.
>> SELECT
>> ProductType,Product,
>> SUM(TotalCases) as TotalCases,
>> UnitofMeasure,
>> DatePart(yyyy, DDate) as YDate,
>> DateName(mm,DDate) as MDate
>> FROM
> fn_CreateBlankSalesCases(@.StartDate,@.EndDate,@.Broker,@.Customer,@.CustomerShip
>> To)
>> GROUP BY ProductType,Product,UnitofMeasure,DDate
>> Regards,
>> Cem
>>
>|||Lev,
Below you may find the functions you requested. Thanks.
Regards,
Cem
CREATE FUNCTION fn_CreateBlankSalesCases (
@.StartDate as DateTime,
@.EndDate as DateTime,
@.Broker as VarChar(50),
@.Customer as VarChar(50),
@.CustomerShip as VarChar(50),
@.BrandName as VarChar(50),
@.CanSize as VarChar(50))
RETURNS @.DateTable TABLE (
ProductType VarChar(150),
Product VarChar(150),
TotalCases Int,
UnitofMeasure VarChar(10),
DDate DateTime)
/*Table created in memory*/
AS
BEGIN
DECLARE @.StartTempDate as DateTime
DECLARE @.ProductType as VarChar(150)
DECLARE @.Product as VarChar(150)
DECLARE @.TotalCases as Int
DECLARE @.UnitofMeasure as VarChar(10)
DECLARE @.TDate as DateTime
SET @.StartTempDate = @.StartDate
/* String manupilation for the brandname */
If (@.CanSize IS NULL)
SET @.CanSize = '%'
ELSE
SET @.CanSize = '%' + @.CanSize + '%'
If (@.BrandName IS NULL)
SET @.BrandName = '%'
ELSE
SET @.BrandName = @.BrandName + '%'
DECLARE SalesActualProducts CURSOR FOR
SELECT
can_typ1.description AS ProductType,
plldb1.descl_plldbx AS Product,
sitem1.qty_sd AS TotalCases,
sitem1.um_sd AS UnitofMeasure,
CAST(CAST(MONTH(shead1.post_date) AS varchar(20)) + '/1/' +
CAST(YEAR(shead1.post_date) AS varchar(20)) AS datetime) AS TDate
FROM can_typ1 INNER JOIN
plldb1 ON can_typ1.type_mstr = plldb1.can_type INNER JOIN
sitem1 ON plldb1.part_mstr = sitem1.part_sd INNER JOIN
shead1 ON sitem1.sorder_sd = shead1.sorder_so
WHERE
(NOT (shead1.sotype_so = 'V')) AND
(NOT (shead1.post_date IS NULL)) AND
(shead1.post_date > @.StartDate) AND
(shead1.post_date < @.EndDate) AND
(shead1.sales_so = @.Broker) AND
(shead1.billto_so = COALESCE(@.Customer, shead1.billto_so)) AND
(shead1.shipto_so = COALESCE(@.CustomerShip, shead1.shipto_so))AND
(sitem1.part_sd LIKE @.BrandName) AND
(can_typ1.can_size LIKE @.CanSize)
GROUP BY
can_typ1.description,
plldb1.descl_plldbx,
sitem1.qty_sd,sitem1.um_sd,
CAST(CAST(MONTH(shead1.post_date) AS varchar(20)) + '/1/' +
CAST(YEAR(shead1.post_date) AS varchar(20)) AS datetime)
/*Start to insert data into the table */
OPEN SalesActualProducts
FETCH NEXT FROM
SalesActualProducts INTO @.ProductType, @.Product, @.TotalCases,
@.UnitofMeasure, @.TDate
WHILE @.@.FETCH_STATUS = 0
BEGIN
INSERT INTO @.DateTable VALUES (@.ProductType,
@.Product,@.TotalCases,@.UnitofMeasure,@.TDate)
FETCH NEXT FROM SalesActualProducts INTO @.ProductType, @.Product,
@.TotalCases, @.UnitofMeasure, @.TDate
END
CLOSE SalesActualProducts
DECLARE SalesProducts CURSOR FOR
SELECT
can_typ1.description AS ProductType,
plldb1.descl_plldbx AS Product,
sitem1.qty_sd AS TotalCases,
sitem1.um_sd AS UnitofMeasure,
CAST(CAST(MONTH(shead1.post_date) AS varchar(20)) + '/1/' +
CAST(YEAR(shead1.post_date) AS varchar(20)) AS datetime) AS TDate
FROM can_typ1 INNER JOIN
plldb1 ON can_typ1.type_mstr = plldb1.can_type INNER JOIN
sitem1 ON plldb1.part_mstr = sitem1.part_sd INNER JOIN
shead1 ON sitem1.sorder_sd = shead1.sorder_so
WHERE
(NOT (shead1.sotype_so = 'V')) AND
(NOT (shead1.post_date IS NULL)) AND
(shead1.post_date > @.StartDate) AND
(shead1.post_date < @.EndDate) AND
(shead1.sales_so = @.Broker) AND
(shead1.billto_so = COALESCE(@.Customer, shead1.billto_so)) AND
(shead1.shipto_so = COALESCE(@.CustomerShip, shead1.shipto_so))AND
(sitem1.part_sd LIKE @.BrandName) AND
(can_typ1.can_size LIKE @.CanSize)
GROUP BY
can_typ1.description,
plldb1.descl_plldbx,
sitem1.qty_sd,sitem1.um_sd,
CAST(CAST(MONTH(shead1.post_date) AS varchar(20)) + '/1/' +
CAST(YEAR(shead1.post_date) AS varchar(20)) AS datetime)
/*Start to insert data into the table */
OPEN SalesProducts
FETCH NEXT FROM
SalesProducts INTO @.ProductType, @.Product, @.TotalCases, @.UnitofMeasure,
@.TDate
WHILE @.@.FETCH_STATUS = 0
BEGIN
WHILE (@.StartDate < @.EndDate)
BEGIN
INSERT INTO @.DateTable VALUES (@.ProductType,
@.Product,0,@.UnitofMeasure,@.StartDate)
SET @.StartDate = DATEADD(month, 1, @.StartDate)
END
SET @.StartDate = @.StartTempDate
FETCH NEXT FROM SalesProducts INTO @.ProductType, @.Product, @.TotalCases,
@.UnitofMeasure, @.TDate
END
CLOSE SalesProducts
/*Return Table*/
RETURN
END
CREATE FUNCTION fn_CreateCanList()
RETURNS
@.CanTable TABLE (
CanSize VarChar(150),
CanSizeOld VarChar(150)
)
/*Table created in memory*/
AS
BEGIN
DECLARE @.CanSizeTemp as VarChar(50)
DECLARE CanSizeList CURSOR FOR
SELECT DISTINCT can_size
FROM can_typ1
WHERE can_size IS NOT NULL
/*Start to insert data into the table */
OPEN CanSizeList
FETCH NEXT FROM
CanSizeList INTO @.CanSizeTemp
WHILE @.@.FETCH_STATUS = 0
BEGIN
IF CHARINDEX('/',@.CanSizeTemp) > 0
INSERT INTO @.CanTable
VALUES(RIGHT(RTRIM(@.CanSizeTemp),LEN(@.CanSizeTemp)-CHARINDEX('/',@.CanSizeTem
p)) ,@.CanSizeTemp)
ELSE
INSERT INTO @.CanTable VALUES(@.CanSizeTemp, @.CanSizeTemp)
FETCH NEXT FROM CanSizeList INTO @.CanSizeTemp
END
CLOSE CanSizeList
/*Return Table*/
RETURN
END
"Lev Semenets [MSFT]" <levs@.microsoft.com> wrote in message
news:uQ8Q1hnfEHA.3928@.TK2MSFTNGP11.phx.gbl...
> Could you send me definitions of your functions fn_CreateBlankSalesCases
and
> fn_CreateCanList?
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "Cem Demircioglu" <cem@.NoSpamPlease.com> wrote in message
> news:uNgnLbhfEHA.2848@.TK2MSFTNGP10.phx.gbl...
> >
> >
> > Some more information about the parameter bug.
> >
> > When I add the parameter manually (Report > Report Parameters), the
query
> > below blows at run time, works perfect at query designer.
> >
> > The way I get around this problem was to define the parameter in the
> > result
> > query first. The moment I add it to the function below, it shows up in
> > report parameters. After configuration works perfect.
> >
> > /*Main query*/
> > SELECT
> > ProductType,Product,
> > SUM(TotalCases) as TotalCases,
> > UnitofMeasure,
> > DatePart(yyyy, DDate) as YDate,
> > DateName(mm,DDate) as MDate
> >
> > FROM
> >
fn_CreateBlankSalesCases(@.StartDate,@.EndDate,@.Broker,@.Customer,@.CustomerShip
> > ,@.BrandName,@.CanSize)
> > GROUP BY ProductType,Product,UnitofMeasure,DDate
> >
> > /*Parameter query*/
> > SELECT DISTINCT CanSize, CanSize as CanSizeDisplay FROM
> > fn_CreateCanList()
> > UNION
> > SELECT Null , '--Select All--'
> >
> > Regards,
> > Cem
> >
> > "Cem Demircioglu" <cem@.NoSpamPlease.com> wrote in message
> > news:%23VP2%23ZmeEHA.2812@.tk2msftngp13.phx.gbl...
> >>
> >>
> >> Microsoft gang,
> >>
> >> I have the following query. if I use @.Shipping instead of
@.CustomerShipTo
> > as
> >> a parameter name, at the preview stage, I receive @.StartDate not
defined
> >> error.
> >>
> >> SELECT
> >> ProductType,Product,
> >> SUM(TotalCases) as TotalCases,
> >> UnitofMeasure,
> >> DatePart(yyyy, DDate) as YDate,
> >> DateName(mm,DDate) as MDate
> >>
> >> FROM
> >>
> >
fn_CreateBlankSalesCases(@.StartDate,@.EndDate,@.Broker,@.Customer,@.CustomerShip
> >> To)
> >> GROUP BY ProductType,Product,UnitofMeasure,DDate
> >>
> >> Regards,
> >> Cem
> >>
> >>
> >
> >
>