Monday, March 26, 2012
how to change query that runs report programmatically
--
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.Please look into BOL for "Using Dynamic Queries"
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"SqlJunkies User" <User@.-NOSPAM-SqlJunkies.com> wrote in message
news:OtGrybSkEHA.2668@.TK2MSFTNGP10.phx.gbl...
>I have a report that will display certain records based on the user that
>logs in. I need to be able to change the query the report uses
>programmatically. I havent had any luck trying to find how to do this
>online. If anyone can help me that would be great.
>
> --
> Posted using Wimdows.net NntpNews Component -
> Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine
> supports Post Alerts, Ratings, and Searching.
Friday, March 23, 2012
How to change display format of my meaure?
Is it possile to definea custom format for the 'display format' property of a measure so that the results are shown in Thousands or Millions or Billions e.g
100,000 can be shown either as 100T
OR
1,000,000 can beshown as 10M
OR
10,000,000 1B
Sorry if I got my numbers wrong but I hope you get the idea?
Looking forward to your help. ThanksLook, you can write code or a function using conversion and text manipulation functions to display the value however you want, but a general principle of database application design is that data formatting is the job of the interface, not the database server. I strongly suggest that you use your interface or reporting tool to format your results (and Query Analyzer is not a user interface!).
Wednesday, March 21, 2012
How to change data in a crystal report
I have developed a report where i have field called Required. It has a value either 1 or 0 in database. Now I want to display 'Required' if the value is 1 and 'Not Required' if the value is 0. Plz help me to do so...
Thanks in Advance..
PrashanthHi all,
I came to know that this problem can be sorted out by writing a formula. But I dont know how to write a formula. Anybody help me...
IIF (({HY_PDC_PARAMETER_SET_DTL.REQUIRED}= '1'),'Required' ,'NotRequired' )
When I write so its displayin Required for all rows...
Thanks in Advance,
Prashanth.M|||Hi
there's nothing wrong with the formula u have written,
but if the field is numeric type then you don't need the quotes and if it is a bit data type then you need to check the field with true or false.
You can also try the formula in this way :
if {table.Required}=1 then 'Required' else 'Not Required'
Monday, March 12, 2012
How to capture the only "time" into the database
I've a textbox that displays the current time in this format "hh:mm:ss tt" but when it is save into the database it'll display the date and time together. So how do I save only the time into the database? My codes is as shown below:
txtTime.Text = DateTime.Now.ToLongTimeString()
Dim
parameterDateAs SqlParameter =New SqlParameter("@.Date_5",SqlDbType.DateTime)parameterDate.Value = txtDate.Text
objCommand.Parameters.Add(parameterDate)
I've tried using Format() but it still get the same results. Can someone help me out? Thanks!
The SQL Datetime datatype will always store a date portion. as effectively all you are doing is storing a time difference since an initial base date/time.
Perhaps change your SQL datatype to varchar and store the time as a string, or else use a constant date along with your time value (IE 1/1/1900).
Dave
Friday, March 9, 2012
how to call Excel file in SSRS
Hi ,
I have one report in SSRS , in my report I have one table that display severel links,
and when I click in one line in the table I want to display the Excel file linked to this line.
exemmple :
Line1: Report Balance
Line2: Report Statistic
.....
and When i click on the line1 it will call one Excel file called RPTBAL.xls
Thanks for your help
Where are these Excel files? On a web server? If so, you can add a hyperlink expression that points to the Excel file for each row.
You can't add them on an entire row but you could add them on all the textboxes in the row. You can also make the hyperlink dynamic based on the content of the textbox. That way each row could point to a different file.
|||Thanks for your eplay , is correct and I tested it and it works fine,
but each time it gives meesage when I call this Excel file , so please you have solution about this , to don't ask me in each call ,
I have the same problem in sharepoint when I call Excel file it dispay message before to open the file .
Regards
Wednesday, March 7, 2012
How to calculate the midpoint
of low and high and display it.
Date,Low,High
20071106,92.03,92.13
20071106,88.77,88.87
20071106,90.20,90.30
20071106,95.21,95.31
20071106,93.13,93.23
20071106,91.01,91.11On Wed, 07 Nov 2007 06:48:09 -0800, amj1020 wrote:
Quote:
Originally Posted by
>I have three fields date, low, high. I need to calculate the midpoint
>of low and high and display it.
Hi amj1020,
SELECT "date", (low + high) / 2.0 AS midpoint
FROM YourTable;
--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis