Showing posts with label invalid. Show all posts
Showing posts with label invalid. Show all posts
Wednesday, March 7, 2012
Argument data type nvarchar is invalid for argument 2 of dateadd function.
Situation:
I have build a query, using the DATEADD function, which executed without any error in SQL Server Management Studion (SSMS). I want to use this query as a dataset in my SQL Server Reporting Service Report (SSRS). I paste the query in the query designer window of my dataset. After I press the OK button of the Query designer, I got next error message:
Argument data type nvarchar is invalid for argument 2 of dateadd function.
This is the part of the query with the DATEADD function:
(SELECT DATEADD(HOUR, @MeasureHourStart, @MeasureDateStart) AS XXXX)
In my report I have report parameters @MeasureHourStart (INT) and @MeasureDateStart (DateTime)
Solution:
SSRS still sees @MeasureHourStart as a Varchar value.
As a workaround I forced to set the value of @MeasureHourStart as an Integer by using the CAST function.
(SELECT DATEADD(HOUR, CAST(@MeasureHourStart AS INT), @MeasureDateStart) AS XXXX)
Now the query will be accepted by SSRS as a valid dataset.
Wednesday, February 10, 2010
The Compressed (zipped) Folder is invalid or corrupted.
Today, somebody in my company reported an issue with opening a ZIP file which he downloaded from an FTP site. He got the error: The Compressed (zipped) Folder is invalid or corrupted.
Situation:
The ZIP file was created by me a few days ago and uploaded to the FTP site. The ZIP file is downloaded and extracted a lot during these days by different people. So why is it not possible to extract the ZIP file on his Windows XP computer? Even when I downloaded the ZIP file on his computer and copied it to my pc, I could open the ZIP file without any error. This confirms that the ZIP was not corrupt. However we were unable to open the file on his PC. The ZIP file was created on my PC with the 64 bits version of Windows 7. The PC on which we could not extract the ZIP, is an 32 bits version of Windows XP.
Solution: Ask the creator of the ZIP file to recreate the ZIP file by sending the files to a compressed (zipped) folder on a 32 bits version of Windows 7.
Now the compressed file can be opened on a 32 bits Windows XP version.
Happy, unzipping your ZIP files.
Situation:
The ZIP file was created by me a few days ago and uploaded to the FTP site. The ZIP file is downloaded and extracted a lot during these days by different people. So why is it not possible to extract the ZIP file on his Windows XP computer? Even when I downloaded the ZIP file on his computer and copied it to my pc, I could open the ZIP file without any error. This confirms that the ZIP was not corrupt. However we were unable to open the file on his PC. The ZIP file was created on my PC with the 64 bits version of Windows 7. The PC on which we could not extract the ZIP, is an 32 bits version of Windows XP.
Solution: Ask the creator of the ZIP file to recreate the ZIP file by sending the files to a compressed (zipped) folder on a 32 bits version of Windows 7.
Now the compressed file can be opened on a 32 bits Windows XP version.
Happy, unzipping your ZIP files.
Subscribe to:
Posts (Atom)

