显示标签为“returns”的博文。显示所有博文
显示标签为“returns”的博文。显示所有博文

2012年3月27日星期二

float datatype

I have several fields in a table with a float datatype. When the user
enters 1.1 into the database, it returns 1.1000000000000001 -- I would think
it should be 1.1000000000000000.
Won't this eventually cause mathematically errors and what do I do about
this.
FLOAT is an approximate numeric type. If you require accurate,
fixed-precision results from calculations then use an exact type such as
NUMERIC.
David Portas
SQL Server MVP

float datatype

I have several fields in a table with a float datatype. When the user
enters 1.1 into the database, it returns 1.1000000000000001 -- I would think
it should be 1.1000000000000000.
Won't this eventually cause mathematically errors and what do I do about
this.FLOAT is an approximate numeric type. If you require accurate,
fixed-precision results from calculations then use an exact type such as
NUMERIC.
David Portas
SQL Server MVP
--

float datatype

I have several fields in a table with a float datatype. When the user
enters 1.1 into the database, it returns 1.1000000000000001 -- I would think
it should be 1.1000000000000000.
Won't this eventually cause mathematically errors and what do I do about
this.FLOAT is an approximate numeric type. If you require accurate,
fixed-precision results from calculations then use an exact type such as
NUMERIC.
--
David Portas
SQL Server MVP
--

2012年3月22日星期四

Flat file produced but need line returns

My Integration Services creates a flat file using OLE DB Source and then a Flat File Destination. The flat file is created from data from my data source with is just a table with many rows.

Each row in my flat file .txt is appended onto each other, there are no line returns after each record. How can I put in a return after each row in my flat file that is outputted from the Flat File Destination component in conjunction with the properties in my Flat File Connection Manager. What am I missing here in order to ensure each row from my table creates a carriage return in my .txt flat file?

The column separator for your last column need to be {CR}{LF}

HTH,
Ovidiu

|||

In my File Connection Manager, I have {CR}{LF} for the header row delimeter but it's not putting a return at the end of each row in my flat file still.

I do not have a header row since this is coming straight from the table so I don't understand why the requirement to specify header information in the File Connection Manager at this point but it is required.

So I'm not sure what else I'm missing, my flat file still doesn't return each row, it appends each row right after another still.

|||I see what you're saying, put

{CR}{LF}

in the column delimeter for the last column's properties, is this correct? If so, I can't that property is greyed out (because it doesn't need it when specifying a flat file) when I click on the last column in the Advanced Tab of the File Connection Manager.

I just don't see where to specify the row delimeters after looking at all the tabs.

|||

Here's my flat file, still doesn't have carriage returns:

http://photopizzaz.biz/junk/flat_file.txt

|||What format are you using for your flat file? You should use RaggedRight if you want carriage returns at the end of your row.|||

The file needs to be a fixed format of 100 bytes. It needs to be formatted like this:

http://www.photopizzaz.biz/junk/final_flat_file.txt

It has to have line carriages just like this one.

|||Ranjeeta , you just made my day, thank you! it was so obvious but I had no clue!|||I had trouble figuring that out too and found the ragged-right solution on my own. But I have a different problem now. I specified a multi-line header in the flat-file destination component, but the text file produced only uses the line-endings of the header when viewed in WordPad or some other advanced text editor.

Notepad only shows little boxes and this make the header useless.

How do I get a real line-ending into the file at the end of each of my header lines so that notepad will display it properly?

Thanks!|||Don't use notepad. Try VIM, or wordpad, or TextPad or something like that. Notepad is a "dumb" editor and can't handle too many special characters.|||That particular solution is already in place. Some of my users are stubborn. You know how that goes. Notepad is their friend... In any case, there are a large number of less savvy software packages out there that will have the same trouble as notepad, and it would be nice for everyone using SSIS to be able to produce flat files that they can consume.

TextPad is what I generally use. Wordpad works too.

Thanks though.|||Right, but Notepad only processes CR-LF line terminations. If a line terminates with LF, it won't display correctly in Notepad. You can't do anything about that, unless you issue a CR-LF.

Flat file produced but need line returns

My Integration Services creates a flat file using OLE DB Source and then a Flat File Destination. The flat file is created from data from my data source with is just a table with many rows.

Each row in my flat file .txt is appended onto each other, there are no line returns after each record. How can I put in a return after each row in my flat file that is outputted from the Flat File Destination component in conjunction with the properties in my Flat File Connection Manager. What am I missing here in order to ensure each row from my table creates a carriage return in my .txt flat file?

The column separator for your last column need to be {CR}{LF}

HTH,
Ovidiu

|||

In my File Connection Manager, I have {CR}{LF} for the header row delimeter but it's not putting a return at the end of each row in my flat file still.

I do not have a header row since this is coming straight from the table so I don't understand why the requirement to specify header information in the File Connection Manager at this point but it is required.

So I'm not sure what else I'm missing, my flat file still doesn't return each row, it appends each row right after another still.

|||I see what you're saying, put

{CR}{LF}

in the column delimeter for the last column's properties, is this correct? If so, I can't that property is greyed out (because it doesn't need it when specifying a flat file) when I click on the last column in the Advanced Tab of the File Connection Manager.

I just don't see where to specify the row delimeters after looking at all the tabs.

|||

Here's my flat file, still doesn't have carriage returns:

http://photopizzaz.biz/junk/flat_file.txt

|||What format are you using for your flat file? You should use RaggedRight if you want carriage returns at the end of your row.|||

The file needs to be a fixed format of 100 bytes. It needs to be formatted like this:

http://www.photopizzaz.biz/junk/final_flat_file.txt

It has to have line carriages just like this one.

|||Ranjeeta , you just made my day, thank you! it was so obvious but I had no clue!|||I had trouble figuring that out too and found the ragged-right solution on my own. But I have a different problem now. I specified a multi-line header in the flat-file destination component, but the text file produced only uses the line-endings of the header when viewed in WordPad or some other advanced text editor.

Notepad only shows little boxes and this make the header useless.

How do I get a real line-ending into the file at the end of each of my header lines so that notepad will display it properly?

Thanks!|||Don't use notepad. Try VIM, or wordpad, or TextPad or something like that. Notepad is a "dumb" editor and can't handle too many special characters.|||That particular solution is already in place. Some of my users are stubborn. You know how that goes. Notepad is their friend... In any case, there are a large number of less savvy software packages out there that will have the same trouble as notepad, and it would be nice for everyone using SSIS to be able to produce flat files that they can consume.

TextPad is what I generally use. Wordpad works too.

Thanks though.|||Right, but Notepad only processes CR-LF line terminations. If a line terminates with LF, it won't display correctly in Notepad. You can't do anything about that, unless you issue a CR-LF.

2012年3月19日星期一

Fixed Width Text Report

I'm trying to create a fixed width text report. I've created a function that
takes a string and a length and returns the string either truncated or padded
with spaces to the given length.
I then use url parameters to modify the CSV device information settings to
change the encoding to ascii, change the extension to txt and change the
FieldDelimiter to %1f (unicode symbol for some kind of field grouping or
something).
Things seems to properly but I don't like having to set the FieldDelimiter
to anything. I tried setting it to null by saying isnull=true but that
generates an error about referencing a null object. I read something that
said to make it an empty string but I can seem to be able to do that using
url parameters. I could try it programmatically but I would prefer using the
url.
Does anyone have any ideas?(The parent post is mine, I just changed my login)
I decided that setting the FieldDelimiter to %1f was not a good idea. I
did try to set the parameter to an empty string programmatically but it
just went to the default comma delimiter.
I've decided to just plug in the url encoded value of which stands
for a null ascii character. I don't know if this is the best solution
but I am going with it. Here is my final url:
http://localhost/ReportServer?/Devel/TestFile&rs:Format=CSV&rs:Command=Render&rc:Extension=txt&rc:NoHeader=true&rc:FieldDelimiter=&rc:Encoding=ascii
If anyone else comes up with any other ideas of how to use RS to create
fixed width text files I would be glad to hear them. I can't find
anything that explains a way of doing this. This would work perfect if
I could set the FieldDemlimiter parameter to nothing but it keeps going
to the default comma.
Thanks.
Gary

2012年3月9日星期五

Fiscal or Calendar Year Function error

Hello,
I am trying to create a function that returns the first day of the fiscal or
calendar year depending on the parameter supplied. However, I get the
error: Error 443: Invalid use of the 'getdate' within a function.
Any help would be appreciated.
Thanks in advance, sck10
CREATE FUNCTION dbo.fn_GetCalendarFiscalYear (@.YearType varchar(100))
RETURNS varchar(255)
AS
BEGIN
Declare @.strCalendarFiscal varchar(255)
SELECT @.strCalendarFiscal =
CASE
WHEN @.YearType = 'calendar' Then '1/1/' + Convert(varchar(255),
year(getdate()))
WHEN @.YearType = 'fiscal' Then
CASE
WHEN month(getdate()) BETWEEN 10 AND 12 THEN
'10/1/' + Convert(varchar(255), year(getdate()))
ELSE
'10/1/' + Convert(varchar(255), year(getdate()) - 1)
END
ELSE 'Pick "calendar" or "fiscal"'
END AS 'strFiscalYearStart'
RETURN @.strCalendarFiscal
Hi,
Welcome to use MSDN Managed Newsgroup!
I am so sorry that you can not put a function that returns a varible
result in a user defined function. Check MVP Aaron Bertrand's article for
this issue
How do I use GETDATE() within a User-Defined Function (UDF)?
http://www.aspfaq.com/2439
Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.

Fiscal or Calendar Year Function error

Hello,
I am trying to create a function that returns the first day of the fiscal or
calendar year depending on the parameter supplied. However, I get the
error: Error 443: Invalid use of the 'getdate' within a function.
Any help would be appreciated.
Thanks in advance, sck10
CREATE FUNCTION dbo.fn_GetCalendarFiscalYear (@.YearType varchar(100))
RETURNS varchar(255)
AS
BEGIN
Declare @.strCalendarFiscal varchar(255)
SELECT @.strCalendarFiscal = CASE
WHEN @.YearType = 'calendar' Then '1/1/' + Convert(varchar(255),
year(getdate()))
WHEN @.YearType = 'fiscal' Then
CASE
WHEN month(getdate()) BETWEEN 10 AND 12 THEN
'10/1/' + Convert(varchar(255), year(getdate()))
ELSE
'10/1/' + Convert(varchar(255), year(getdate()) - 1)
END
ELSE 'Pick "calendar" or "fiscal"'
END AS 'strFiscalYearStart'
RETURN @.strCalendarFiscalHi,
Welcome to use MSDN Managed Newsgroup!
I am so sorry that you can not put a function that returns a varible
result in a user defined function. Check MVP Aaron Bertrand's article for
this issue
How do I use GETDATE() within a User-Defined Function (UDF)?
http://www.aspfaq.com/2439
Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Fiscal or Calendar Year Function error

Hello,
I am trying to create a function that returns the first day of the fiscal or
calendar year depending on the parameter supplied. However, I get the
error: Error 443: Invalid use of the 'getdate' within a function.
Any help would be appreciated.
Thanks in advance, sck10
CREATE FUNCTION dbo.fn_GetCalendarFiscalYear (@.YearType varchar(100))
RETURNS varchar(255)
AS
BEGIN
Declare @.strCalendarFiscal varchar(255)
SELECT @.strCalendarFiscal =
CASE
WHEN @.YearType = 'calendar' Then '1/1/' + Convert(varchar(255),
year(getdate()))
WHEN @.YearType = 'fiscal' Then
CASE
WHEN month(getdate()) BETWEEN 10 AND 12 THEN
'10/1/' + Convert(varchar(255), year(getdate()))
ELSE
'10/1/' + Convert(varchar(255), year(getdate()) - 1)
END
ELSE 'Pick "calendar" or "fiscal"'
END AS 'strFiscalYearStart'
RETURN @.strCalendarFiscalHi,
Welcome to use MSDN Managed Newsgroup!
I am so sorry that you can not put a function that returns a varible
result in a user defined function. Check MVP Aaron Bertrand's article for
this issue
How do I use GETDATE() within a User-Defined Function (UDF)?
http://www.aspfaq.com/2439
Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

2012年2月26日星期日

First returns incorrect row

This is a multi-part message in MIME format.
--020206060805020100000401
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
It seems First is returning the first row returned by the Dataset, not
the first row according to the sorting of the dataregion or grouping (as
the First function's documentation implies). This ends up with some
mysterious results in my reports. I created a simple example using the
SQL Northwind that shows the problem and attached it. Is this a bug or
intended behavior? It makes some of my reports using sorted groups have
seemingly bogus results when viewed.
Thanks,
Aaron
--020206060805020100000401
Content-Type: text/xml;
name="FirstLastAnomaly1.rdl"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="FirstLastAnomaly1.rdl"
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<RightMargin>1in</RightMargin>
<Body>
<ReportItems>
<Table Name="table1">
<Height>1in</Height>
<Style />
<DataSetName>Northwind</DataSetName>
<Top>0.125in</Top>
<Width>3.25in</Width>
<TableGroups>
<TableGroup>
<Header>
<TableRows>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox10">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>#8080ff</BackgroundColor>
<TextAlign>Left</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>7</ZIndex>
<rd:DefaultName>textbox10</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!FirstName.Value & " " & Fields!LastName.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox11">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>#8080ff</BackgroundColor>
<TextAlign>Right</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>6</ZIndex>
<rd:DefaultName>textbox11</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox16">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>#8080ff</BackgroundColor>
<TextAlign>Left</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>5</ZIndex>
<rd:DefaultName>textbox16</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>="1st:" & First(Fields!City.Value)</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox17">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>#8080ff</BackgroundColor>
<TextAlign>Right</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>4</ZIndex>
<rd:DefaultName>textbox17</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>="1st:" & First(Fields!OrderID.Value)</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox3">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>#8080ff</BackgroundColor>
<TextAlign>Left</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>3</ZIndex>
<CanGrow>true</CanGrow>
<Value>="Last:" & Last(Fields!City.Value)</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox2">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>#8080ff</BackgroundColor>
<TextAlign>Right</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>2</ZIndex>
<rd:DefaultName>textbox2</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>="Last:" & Last(Fields!OrderID.Value)</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Header>
<Grouping Name="table1_Group1">
<GroupExpressions>
<GroupExpression>=Fields!FirstName.Value & " " & Fields!LastName.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<Sorting>
<SortBy>
<SortExpression>=Fields!FirstName.Value & " " & Fields!LastName.Value</SortExpression>
<Direction>Ascending</Direction>
</SortBy>
</Sorting>
</TableGroup>
<TableGroup>
<Header>
<TableRows>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox19">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>#80ff80</BackgroundColor>
<TextAlign>Left</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>1</ZIndex>
<rd:DefaultName>textbox19</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!City.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox20">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>#80ff80</BackgroundColor>
<TextAlign>Right</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<rd:DefaultName>textbox20</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=First(Fields!OrderID.Value)</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Header>
<Grouping Name="table1_Group2">
<GroupExpressions>
<GroupExpression>=Fields!City.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<Sorting>
<SortBy>
<SortExpression>=Fields!City.Value</SortExpression>
<Direction>Ascending</Direction>
</SortBy>
</Sorting>
</TableGroup>
</TableGroups>
<TableColumns>
<TableColumn>
<Width>1.5in</Width>
</TableColumn>
<TableColumn>
<Width>1.75in</Width>
</TableColumn>
</TableColumns>
</Table>
</ReportItems>
<Style />
<Height>1.25in</Height>
</Body>
<TopMargin>1in</TopMargin>
<DataSources>
<DataSource Name="Northwind">
<rd:DataSourceID>b54bf116-08cc-4b39-aa96-57013b5de15d</rd:DataSourceID>
<ConnectionProperties>
<DataProvider>SQL</DataProvider>
<ConnectString>data source=localhost;initial catalog=Northwind</ConnectString>
<IntegratedSecurity>true</IntegratedSecurity>
</ConnectionProperties>
</DataSource>
</DataSources>
<Width>3.375in</Width>
<DataSets>
<DataSet Name="Northwind">
<Fields>
<Field Name="CompanyName">
<DataField>CompanyName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="CustomerID">
<DataField>CustomerID</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="OrderID">
<DataField>OrderID</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="LastName">
<DataField>LastName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="FirstName">
<DataField>FirstName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="EmployeeID">
<DataField>EmployeeID</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="City">
<DataField>City</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
<Query>
<DataSourceName>Northwind</DataSourceName>
<CommandText>SELECT Customers.CompanyName, Customers.CustomerID, Orders.OrderID, Employees.LastName, Employees.FirstName, Employees.EmployeeID,
Customers.City
FROM Customers INNER JOIN
Orders ON Customers.CustomerID = Orders.CustomerID INNER JOIN
Employees ON Orders.EmployeeID = Employees.EmployeeID</CommandText>
</Query>
</DataSet>
</DataSets>
<LeftMargin>1in</LeftMargin>
<rd:SnapToGrid>true</rd:SnapToGrid>
<rd:DrawGrid>true</rd:DrawGrid>
<rd:ReportID>c31d746f-9224-4fcd-8568-e5376409e635</rd:ReportID>
<BottomMargin>1in</BottomMargin>
<Language>en-US</Language>
</Report>
--020206060805020100000401--Yes, you're right. Do your sort in the dataset query not in the dataregion
Sorting tab.
Use ORDER BY in the query, that is.
Charles Kangai, MCT, MCDBA
"Aaron S." wrote:
> It seems First is returning the first row returned by the Dataset, not
> the first row according to the sorting of the dataregion or grouping (as
> the First function's documentation implies). This ends up with some
> mysterious results in my reports. I created a simple example using the
> SQL Northwind that shows the problem and attached it. Is this a bug or
> intended behavior? It makes some of my reports using sorted groups have
> seemingly bogus results when viewed.
> Thanks,
> Aaron
>|||Thank you for the reply. I have added an order by to the SProc in my
production report and it works, this is not ideal for me as I'd rather
not have the SProc's sort dependent on a report. So is this a bug we
should expect to be corrected?
Thanks again for responding.
Charles Kangai wrote:
> Yes, you're right. Do your sort in the dataset query not in the dataregion
> Sorting tab.
> Use ORDER BY in the query, that is.
> Charles Kangai, MCT, MCDBA
> "Aaron S." wrote:
>
>>It seems First is returning the first row returned by the Dataset, not
>>the first row according to the sorting of the dataregion or grouping (as
>>the First function's documentation implies). This ends up with some
>>mysterious results in my reports. I created a simple example using the
>>SQL Northwind that shows the problem and attached it. Is this a bug or
>>intended behavior? It makes some of my reports using sorted groups have
>>seemingly bogus results when viewed.
>>Thanks,
>>Aaron|||I just want to confirm that SRS ignores the Sort order of the table and
uses the sort order of the SP query. Is version 2 out yet ?!!
Aaron S. wrote:
> Thank you for the reply. I have added an order by to the SProc in my
> production report and it works, this is not ideal for me as I'd
rather
> not have the SProc's sort dependent on a report. So is this a bug we
> should expect to be corrected?
> Thanks again for responding.
>
> Charles Kangai wrote:
> > Yes, you're right. Do your sort in the dataset query not in the
dataregion
> > Sorting tab.
> > Use ORDER BY in the query, that is.
> >
> > Charles Kangai, MCT, MCDBA
> >
> > "Aaron S." wrote:
> >
> >
> >>It seems First is returning the first row returned by the Dataset,
not
> >>the first row according to the sorting of the dataregion or
grouping (as
> >>the First function's documentation implies). This ends up with some
> >>mysterious results in my reports. I created a simple example using
the
> >>SQL Northwind that shows the problem and attached it. Is this a bug
or
> >>intended behavior? It makes some of my reports using sorted groups
have
> >>seemingly bogus results when viewed.
> >>
> >>Thanks,
> >>
> >>Aaron
> >>

First day of a month

Hi to all..
is there a function in sql server 2k that returns the first day of a date (month)??
thx!
Ale.Hmmmm..

SELECT 1

??????|||I'm not sure that I understand, but let's try an example and maybe we can at least get closer:DECLARE @.target DATETIME
SET @.target = GetDate()
SELECT Convert(DATETIME, Convert(CHAR(8), @.target, 121) + '01'), @.target-PatP|||i wouldn't to use cast and convert in string..
i thinked there's a database function..
for example.. dateserial in Visual Basic..
i think that this function are so good =)
don't you think? =))))
ok.. thx anyway..|||What do you see as the problem? If you can coach me a bit as to what you would like to see, I might be able to find you a better answer, but I think that this code does what you requested.

-PatP|||What? 1 is not the first day of the month?

Show us an example of what you are looking for....

Usually the ask for the last day of the month....|||http://www.sqljunkies.com/HowTo/6676BEAE-1967-402D-9578-9A1C7FD826E5.scuk

Maybe this would help :)