|
|
I have created reports using reporting services and also created reportview control in my web applicaion.When i select the report from the dropdown it displays correct report but why it still shows the report paramter of the report even if i slelect some other report from drop down.Pls let me know how i can implement this that when user select some other report before clicking on the report button it should diplay blank page.It should not show the parameters of some other report.
|
|
|
|
|
I have a small search function that searches a telephone database on e.g. surname, suburb, and tel no. The data source is two tables, TelPerson and TelNumber, with one TelPerson record to many TelNumber records. I'm battling a bit with my search SQL, which joins the two tables to allow a search on person details as well as on phone number, but I only want one record returned if the search is on person details only.
For example, Investec Bank have 419 telephone numbers, but if the user searches for 'Investec', I only want to return one record, but if the user also includes a telephone number search criterion, I want to show all the records for Investec where the number matches.
|
|
|
|
|
Its a bit ugly, but I think the following should do the trick:
select P.Name, T.PhoneNumber
from TelPerson as P
inner join TelNumber as N
on N.PersonId = P.PersonId
where (@SearchName = '' or P.Name LIKE '%' + @SearchName + '%')
and (N.PhoneNumber = @SearchPhone or (
@SearchPhone = '' and
N.PhoneNumber in (
select min(PhoneNumber) from TelNumber where PersonId = P.PersonId)
))
order by P.Name, P.PersonId, T.PhoneNumber This assumes that a blank-string equals no criteria. If possible then I would recommend using a stored procedure to make the code more logical.
Regards
Andy
|
|
|
|
|
Thanks Andy, a close variant seems to work just fine.
|
|
|
|
|
Sometimes a UNION can run pretty quick. A simple GROUP BY will eliminate duplicates.
SELECT
TelPersonId
FROM
TelPerson
WHERE
@criteria1 IS NOT NULL AND
Investec LIKE '%' + @criteria1 + '%'
UNION
SELECT
TelPersonId
FROM
TelPerson
INNER JOIN
TelNumber
ON (TelPerson.TelPersonId = TelNumber.TelPersonId)
WHERE
@criteria2 IS NOT NULL AND
TelNumberText LIKE '%' + @criteria2 + '%'
GROUP BY TelPersonId
|
|
|
|
|
i am working on one application where i used sqlserver2005 reporting service.
i used oracle 10g as my datasource for the report.
i deployed report on server successfully.
but what my problem is , on server , where i deployed my report, oracle is not there. so it gives me error when i run report on server.
i want to set connectionstring for the report at runtime so that i can give reference to another server and deploy report on current server where oracle is not there.
i have need to set connectionsting at runtime bcz of when i generate report through report wizard in business intellegence. it takes service name as servername.
now what exactly i want to do is:
i want to deploy report on server having connectionstring to another server.
e.g. On server 'A' , i want to deploy report but connectionstring for the datasource includes server 'B'.
i want to include both servername and servicename in the connectionstring
software developer
|
|
|
|
|
Sorry but im not sure if it's called buffer, but im having a problem pasting all my create table statements in oracle sql*plus..
Not sure how to enlarge that "buffer"
Many thanks
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
I normally save my script as a SQL file, then use the SQL*Plus "start" command to run it.
|
|
|
|
|
Doh.. How??
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
|
The Following number is called an Attribute code
"120080200000"
These are 6 pairs. i want to chance the 5th pair to '10' and not tember with the other pairs. here is the query but it gives me undesirable results.
update property
set attrib_code = substring(attrib_code,1,8)+ substring(attrib_code,9,2)+ '10'
and substring(Attrib_code,11,2) + '00'
where property_id = 15985
Please Help
Vuyiswa
|
|
|
|
|
Vuyiswamb wrote: here is the query but it gives me undesirable results.
You should describe the undesirable results. That way we can concentrate on what is likely to be wrong rather than have to waste time reading the whole thing to figure it out.
If you are normalising your database (which is generally a good idea), the first normal form should split this out in to separate columns. If you need it all joined up you can always create a calculated column for that purpose. If you need it joined up and indexable then a trigger can be created to ensure that happens.
|
|
|
|
|
I understand, mybe you can explain in detail how the substring is working, there are more than 40 000 records, am a junior, i have used this before and it worked, this code i used for something within the organisation. its true am normalasing the table, can you please tell me
how the substring work , i try to google it, but the explanation were not clear, i know there is a starting position and replce position. in this case
xx xx xx xx xx xx i want to change the 5th pair only, but my query temper with the last pair and change the 5th pair please help
Vuyiswa
|
|
|
|
|
Vuyiswamb wrote: mybe you can explain in detail how the substring is working
See the documentation for SUBSTRING[^].
Vuyiswamb wrote: its true am normalasing the table, can you please tell me
I don't know anything else about your table. All I can see is you appear to be modifying only part of a column value. That suggests to me that the column breaks the first normal form. i.e. you should split out all values into separate columns.
SUBSTRING(Value, 1, 8) + ReplacementValue + SUBSTRING(Value, 11, 2) Value is the name of the column, ReplacementValue is the value you want to replace the 5th pair with.
|
|
|
|
|
Thank you it worked, infact we were talking abot the same thing, i did not understand you, but now i do. tell let me ask you something. have you ever modify a large number of records by mistake? if yes what did you do, and how did you feel after that?
Vuyiswa
|
|
|
|
|
Vuyiswamb wrote: have you ever modify a large number of records by mistake?
Yes.
Vuyiswamb wrote: if yes what did you do?
I restored the backup.
Vuyiswamb wrote: how did you feel after that?
Normal. Why?
|
|
|
|
|
what is the maximum number of clients that can connet to a TCP server ( in .net remoting) and what happens if the number of clients reach beyond the max limit?How can we temper the maximum limit?
|
|
|
|
|
hi
I want to make an import from access to mysql on Linux but i have a problem with mysql:the default value of
lower_case_table_names is 0 and i must put the default value of
lower_case_table_names to 1 .
Help please.
thanks
|
|
|
|
|
i inserted the ado data control in my form and went to propertes as usual with the Ado data control, and Build connection string, and choose SQl server a driver and where am supposed to choose my Sql server it gives me an Error.
"Error Enumerating data servers.Enumarator reports 'unspecified error'"
help what would be the problem
Vuyiswa
|
|
|
|
|
how to insert null into datetime field in sql??
can i assign it from asp.net..
pls explain..
thks
|
|
|
|
|
use DBNull.Value
i.e dr["ColDate"] = DBNull.Value
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
How can get the path of a database(.mdb)and name of the tables in that .mdb file?
thanks
|
|
|
|
|
Please help i've many forms inserting to DB SQL
i want to implement a method that reads directly from the Datatable and insert or delete directly to the DB instead of providing the parameters manually.
the update is easy just provide the to the adapter.update()the datatable and it automatically do it
but the insert and delte of the adapter u must provide the paremeters manually.
so did any body though about this before ????
i hope it can works.
|
|
|
|
|
simsem wrote: the insert and delte of the adapter u must provide the paremeters manually.
No you don't. After you create the DataAdapter, you can use an OleDbCommandBuilder or SqlCommandBuilder to create the INSERT, UPDATE and DELETE commands for that adapter. Well, so long as the SELECT is a single table query that is...
Docs on the SqlCommandBuilder are here[^].
|
|
|
|