Show All Except Specific
May 26, 2013
I want to select all those record except those record who have birthdate less then 4/13/1992 and relation= son
I tried this
SELECT * FROM Dependents WHERE code = 2
AND NOT CONTAINS
(SELECT *
FROM Dependents
WHERE BirthDate < '4/13/1992' AND relation= 'son')
But not working....
View 4 Replies
ADVERTISEMENT
Jan 16, 2008
Hello i am doing my final project in my University and i have chosen to do a beta my university portal.I am facing a problem because i don't know how to link students with his specific data when he logs in to the site for example i want to show his specific grades when he logs in or anything else that is related to himand this is what i am using to show the grades with the use of data grid 1 SELECT Student.StudentiId, Student.StudentName, Student.StudentSurname, Course.Course, Exams.Datewritten, Exam.Exam, Exams.Grade2 FROM Student 3 INNER JOIN 4 Exams 5 ON Student.StudentiId = Exams.Studentid 6 INNER JOIN 7 Course 8 ON Exams.Courseid = Course.Courseid 9 INNER JOIN10 Exam 11 ON Exams.Examid = Exam.Examid; I am very confused since i dunno how to do thisShould i need to relate the asp.net membership database with mine?P.S my vb.net skills are low Here is my database Schema
View 8 Replies
View Related
May 20, 2012
I need to show the total amount of rows in a specific table?
The query is as follows:
As part of the planning process to expand the database that supports Northwind operations, the IT manager would like to know how many rows are currently in specific tables so that he can conduct capacity planning.
The results needed include two columns, TableName( containing all the tables in the database and Rows, which contain the total amount of all the rows per table).
View 4 Replies
View Related
Aug 3, 2015
I have built a fact table and few dimension views in Datamart with the aim of creating a Cube.
On the Fact table I have added a CASE Statement with the following threshold for Premium due amounts:
CASE WHEN....
'Due_0-1_Month'
'Due_1-2_Month'
'Due_2-3_Month'
'Due_Over_3_Months'
'Overdue_0-1_Month'
'Overdue_1-3_Month'
'Overdue_3-6_Month'
'Overdue_Over_6_Months'
...END
I then created a Dimension to link this to:
CREATE VIEW...
Select 'Due_0-1_Month' as Ageing_Threshold
union all
Select 'Due_1-2_Month'
union all
Select 'Due_2-3_Month'
[Code] ....
I was successful in processing the cube, however the problem is everytime I drag the dimension on the columns field in Pivot tables the Thresholds start to break up the other amounts that I have on display like Acquisition Costs, Tax amounts. I am only interested in showing the breakdown of Premium amount measure by the Threshold dimension.
somehow 'Hide' or 'prevent' the Threshold dimension from breaking down the other measures on the Pivot and only breakdown the amounts for Premium?
how I should structure my tables in SQL or any MDX queries to resolve this.
View 0 Replies
View Related
Jun 23, 2014
i am currently working on designing a database for a bank as a school project for my database class. We have to draw up an entity relationship diagram, Sql tables, database size estimate etc. I am currently working on the security portion of the project. I need to list the groups that have access to my application and use a grid format to show access to specific tables.
I am currently working on designing a database for a bank as a school project for my database class. We have to draw up an entity relationship diagram, Sql tables, database size estimate etc. I am currently working on the security portion of the project. I need to list the groups that have access to my application and use a grid format to show access to specific tables.
Role Loans Payments Transactions Accounts Customer Emplo
Database Admin SUID SUID SUID SUID SUID SUID
Branch Manager SUI SUI SUI SUI SUI SUI
Internal Auditor S S S S S S
Loan Officer SUID SUI SUI S S
Tellers S S S S SU
Customers U
View 1 Replies
View Related
May 23, 2015
I need to select specific values from all rows where the value of a specific column is "Active"
This part works: SELECT LastName, FirstName, MiddleInit, ClientId FROM dbo.Client
But I want to add: WHERE StatusType = (Active) and how to do this.
View 4 Replies
View Related
Jun 30, 2015
We have a "main" SQL 2014 server who imports XML files using SSIS in a datacenter. In remote sites (which are warehouses), there is an instance of SQL 2014 Express. A merge replication is setup, as every operations done on each site must be "forwared" to the main database, as some XML files are generated as output for an ERP system.
Now, the merge replication replicate all the data to the server on each sites. But a specific site don't need the data of every other sites, only the data relevant to itself (which is the warehouse code). Is there a way to replicate only the data relevant to each individual sites to the subscribers? Or is there a better way than replication to accomplish this?
View 2 Replies
View Related
Oct 10, 2007
I want to ship 500,000 aged transactions each night to an archive table and delete them from their source table in one or more logical units of work (LUW). Each row is approx 60 bytes and there is only one non clustered index on the source table presently.
I'm trying to weigh the pros and cons of 3 alternatives. One of them would basically insert the non-aged rows into tempdb, ship the aged records, truncate the table and then insert the tempdb records back into their source all in the same LUW.
For this alternative, I'd at least like to turn off logging when the records get inserted into tempdb as I dont see any value in logging that part of the activity. Is this possible?
View 4 Replies
View Related
Jan 23, 2007
Hi All,
Could you guys please help me with printing reports invoked thru command line/ URL access to print automatically to specific printers and specific trays and also is it possible to set the specific printer and tray as parameters.
Any suggestions is appreciated
Thanks A lot in advance
e,g :
http://localhost/reportserver?/testreports/employee sales&UserID='ABC'&LName=Lastname='victor'&rs:Command=Render
View 1 Replies
View Related
Mar 27, 2007
Hi there !
Thanks for taking the time to read this thread.
I don't know whether anyone has this problem, but I am definitely not using the right keywords to search for a thread.
My situation is this...
I have a dataset that has values to fill cells to multiple tables in a report.
However, I only want to select specific data from the dataset to fill textboxes and others.
I cannot change the stored procedure, but the sample of the data is shown below:-
Row Stat Val
0 dtRpt1 02/01/2005
1 Value1 1
2 Value2 2000
3 dtMailSent 02/28/2005
4 Value3 0
5 Value4 5
6 Value5 658
I know it looks weird, but the row really represents which "row" or textbox is it to fill with the Val. The Stat Column is just a way to make sure that I am filling the right values.
so my new report would have multiple tables to denote different categories.
In my first table, I tried putting the cells as follows:-
(expressions are highlighted in italics and bold)
TextBox1 =IIF(Fields!Row.Value =0, Fields!Val.Value,"")
Table1
Column1
DetailRow1 =IIF(Fields!Row.Value =1, Fields!Val.Value,"")
DetailRow2 =IIF(Fields!Row.Value =2, Fields!Val.Value,"")
Table2
Column1
DetailRow1 =IIF(Fields!Row.Value =3, Fields!Val.Value,"")
DetailRow2 =IIF(Fields!Row.Value =4, Fields!Val.Value,"")
DetailRow3 =IIF(Fields!Row.Value =5, Fields!Val.Value,"")
DetailRow4 =IIF(Fields!Row.Value =6, Fields!Val.Value,"")
I only expect this report to print out one page holding the previous values.
However, it ended up printing like this
----------------------------------------------------------
Table1
Column1
DetailRow1 1
DetailRow2
Column1
DetailRow1
DetailRow2 2000
Table2
Column1
DetailRow1 02/28/2005
DetailRow2
DetailRow3
DetailRow4
Table2
Column1
DetailRow1
DetailRow2 0
DetailRow3
DetailRow4
Table2
Column1
DetailRow1
DetailRow2
DetailRow3 5
DetailRow4
Table2
Column1
DetailRow1
DetailRow2
DetailRow3
DetailRow4 658
------------------------------------------------------
I tried putting it into the headerrows instead of DetailRows, and it ended up printing the last value.
Is there anyway to do this ? print all the values out in one table ? I tried using textboxes, but I think I got my expression wrong.
Is this the correct expression ?
=IIF((Fields!Row.Value,"Dataset") =1, (Fields!Val.value, "Dataset"), "")
and it give me an error
The value expression for the textbox €˜textbox5€™ contains an error: [BC30455] Argument not specified for parameter 'FalsePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.
Appreciate any advice or suggestion for this scenario !
Thanks!
Bernard
View 3 Replies
View Related
Mar 21, 2008
I am very early on in developing a website to track issues with projects which is tied to a SQL database. I have my Projects Table, my Users Table, and am creating a third table to track issues. I'm wondering what is the best way to assign specific users to specific data/projects. The user should only be able to view & update the projects assigned to him. He should not be able to see other projects. What is the best way to assign projects/data to the users to make sure they are only viewing their data?
View 1 Replies
View Related
Dec 31, 2007
Hi all,
I have two problems.
1. I downloaded ChartFXRSTrial and created one chart, and able to deploy it in ReportServer, but the problem is the reports are not showing there, i checked the configuration of .dll files in the help provided by chartFX, but couldn't get anything, so could help me on this.
2. How to give Tooltip for the X- axis or Y- axis values in the ReportServer , i tried using chartproperties of .rdl file, but didnt understand it. can help me on this, and one more i tried with Dundas too, If im giving tooltip as #valy then, it is showing samething in reportserver instead the values of 'Y-axis'.
Thanks,
Mahesh Manthena
View 1 Replies
View Related
Dec 11, 2006
I'm beginner in asp.net. Can someone show me how to create coding for this page..
i have to create my own login page and database. I'm using sql sever 2005 for database. can someone show me how to make connection with my login button and my database? please....i'm really need help from you all guys.
View 2 Replies
View Related
Mar 6, 2008
I need to flag old records and new records with 1 and 0 respectively... can anyone show me how to do it without having to create a temp table? this is what i've got so far...
create table #tempLRM
([Key] varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS null,
[Start Date] datetime null);
insert into #tempLRM
select [key], min([start date])
from ReportDataLRM
group by [key];
update ReportDataLRM
set multi = 0
from #tempLRM t
where ReportDataLRM.[key]= t.[key]
and ReportDataLRM.[start date] = t.[start date];
update ReportDataLRM
set multi = 1
where multi is null;
select * from ReportDataLRM
View 5 Replies
View Related
Jan 15, 2007
Hi!!
I have a bar chart and the data are agrupped by Folders (Category groups) and by FileType (Series Groups)... I want to show only the 5 folders with the biggest amount of files... how i could do it?
All suggestions will be wellcome... Thx!!
View 10 Replies
View Related
May 18, 2007
In Reports Service SQL 2005
my Fields Value is A, but I list table to show Value is B.
How do it.
Thanks
View 1 Replies
View Related
May 22, 2007
Hi, I'm a newbie doing my very first UPDATE procedure. I want to UPDATE a specific row in my Sql db table, WHERE FirstName = "John" AND LastName = "Smith". What am I missing in my code below to do this specific update: Most greatful for any help, thanks.<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
UpdateCommand="UPDATE [CompanyDepartment] SET [User_Name] = @User_Name, [FirstName] = @FirstName, [LastName] = @LastName, [Company_Name] = @Company_Name, [Department_Name] = @Department_Name WHERE [User_ID] = @User_ID ">
<updateparameters>
<asp:parameter Name="User_Name" Type="String" />
<asp:parameter Name="FirstName" Type="String" />
<asp:parameter Name="LastName" Type="String" />
<asp:Controlparameter Name="Company_Name" Type="String" ControlID ="ListBox1" PropertyName ="SelectedValue" />
<asp:Controlparameter Name="Department_Name" Type="String" ControlID ="ListBox2" PropertyName ="SelectedValue"/>
<asp:parameter Name="User_ID" Type="Int32" />
</updateparameters>
</asp:SqlDataSource>
View 11 Replies
View Related
Jul 13, 2004
SQL question here:
I am setting up a blog, and I would like the data list to default to the most recent post ONLY. How would I define the filter to get the most recent post?
I have a publishing date in my table, and I can sort the post, but I have no clue how to select just one row to display.
I can get it to work by adding a dropdown list the is bound to the publishing date column, then retreving the post based on the control, but I don't want to use the control. (Making the control not visible is not an option.
View 2 Replies
View Related
Jul 31, 2001
I select a couple of rows from a table and sort them by the Date column. Now I would want to return only the 3rd row...
Thanks for any help!
View 1 Replies
View Related
Jun 12, 2003
I have a case where I need to randomly select two different serial numbers (a list of serial number are already in a table) and assign it to two variables. Or select a specific row from a list of results. Is there a direct way to do this?
e.g.
declare @var1 varchar(10), @var2 varchar(10)
select top 1 @var1=Serial from Table order by Serial
select top 1 @var2=Serial from Table where ServTag not in (@var1) order by Serial
select @var1, @var2
:confused:
View 2 Replies
View Related
Jul 12, 2004
Hi, I was wondering, I have several columns of data that are able to be sorted on - the user just clicks on the column name. However, we have 1 column called order status where we don't want the order to be alphabetical (and it is a text field - a couple current possible values are Processing...In Production...Waiting For Approval). This order is not good for logical sorting - we would want to be able to specify what value would get order. Does that make sense? So we would want to be able to say that Processing is first in the display, Waiting For Approval would be next, then In Production would be next, and so on. Is there any possible way of doing this in a SQL query? Or am I going to have to manually modify all the data adding numbers to the beginning of each data so that it will sort on the numbers? Thanks everyone.
View 4 Replies
View Related
Apr 16, 2008
Hi all
How do i set a specific between date in here
i want to add this line or How do i set specific between date
WHERE between '06-06-2005' And '04-01-2007'
SELECT * FROM gradeaverage
WHERE Name='student'
ORDER BY Date
Thank advance
View 9 Replies
View Related
Feb 13, 2004
If we had two SQL 2000 servers each with 2 NIC's. For each server one network card was pointing to an internal network 172.16.x.xxx we use for production. The other NIC (say its 198.16.x.xxx) we wanted to use just for replication purposes between the two servers in an attempt to lighten the network traffic on the 172 network. My question is, can you set up 2 SQL servers to replicate between themselves on a specific IP or Named Pipe?
View 1 Replies
View Related
Apr 11, 2008
Hi.I'd like to add valuse to a row where has this condition:
WHERE affiliate_id = '#session.AffiliateInfo.userid#'
I did it like this:
INSERT INTO tbl_affiliate
(affiliate_tax_number, affiliate_SSN_number)
VALUES
('#Form.SSNumber#','#Form.TIDNumber#')
WHERE affiliate_id = '#session.AffiliateInfo.userid#'
but it gave me error.how should I write the query?
thanks
View 6 Replies
View Related
Apr 12, 2008
Hello Valueable Friends , I have an issue and i am going to need a help..
I have a rents table with fields that matter now
Stuffid , rentdate , rentCustomer ........
On my stuff table i Added a new field called LastCustRent
So I want to update this field With the Customerid that rented each
stuff last time
I tried this
Select Stuffid ,max(rentdate) as maxrentdate , rentcust
from rents
Group by rentcust , stuffid
But I do not take unique results
Can someone help me on how will i get only the customer of my last rent time for each stuffid on my rents table?
I sell my mother in law.Is anybody interested?
View 4 Replies
View Related
Jun 10, 2008
Hi Everyone.
Looong story short. I have a screen with search criteria. Right.
I have table :
tblCandidateLicense
intPkCandidateLicenseID (PK)
intFkCandidateId
intFkLicenseTypeID
And Another table
tblLicenseTypeDef
Columns:
intPkLicenseTypeID (Pk Int)
strDescription
strLicenseCode
intRank (just for ranking)
intRankParent (for grouping types of vehicles)
tblLicenseTypeDef data contains:
1 , MotorCycle < 125,0,1,0
2 , MotorCycle > 125,0,2,0
3 , Car 1 ,0,0,1
4 , Car 2 ,0,1,1
5 , Car 3 ,0,2,1
5 , Car 4 ,0,3,1
tblCandidateLicense data contains
1 , 57, 1
2 , 57, 3
3 , 58, 4
I use the intRank to determine which vehicle is bigger and intRankParent to make groups (so motorbikes and cars searched don't bring back the wrong type)
I want to be able to search on License Type .
But now a person can search for car 4 and motorcyle > 125. Then my query needs to find all the people with car type 4 AND Smaller (car-1-2-3-4) (that is group 4), and motorcycle and smaller (1 and 2) (Group 0)
If a person search for car type Car 3 and motorcycle < 125, then car 1-2-3 and MotorCycle 1 must be returned.
I hope it makes sense.
View 5 Replies
View Related
Sep 22, 2007
I need to increment a value in some rows to keep a list in order. Here's the idea:
UPDATE myList SET OrderNum = OrderNum + 1 WHERE UserID = @UserID, OrderNum >= @OrderNum
This throws an exception. Is there a quick and easy way to update like this?
View 5 Replies
View Related
May 8, 2008
I am trying to count the number of value "99" for each column in the whole table
to see how many "99" are there per column for the whole table...
and get the percentage per each column.. How can I do this for the whole table?
output should look like
Column A 117 10%
Column B 120 14%
-- etc..
View 2 Replies
View Related
Apr 7, 2008
Hi guys . I've been trying to find an answer to my question on a different forums, but unsecsessfull.
You may had this issue before and can give me an idea of how to solve it.
I have to add a row to my query , but the problem is I have to show it a specific way. Let's say the values for that row are different colours, so
what I what to show is a selection of RED, GREEN, YELLOW and OTHERS (as all other colours. )
I can filter by RED GREEN and YELLOW but how to group all others under one group called OTHERS ?
Example :
([Product Colour Type].[Colour Type].CURRENTMEMBER.UNIQUENAME=[Product Colour Type].[Colour Type].&[RED] OR
[Product Colour Type].[Colour Type].CURRENTMEMBER.UNIQUENAME=[Product Colour Type].[Colour Type].&[GRN] )
Product Colour Quantity
676987 RED 3
98965 GREEN 2
1213 OTHER 15
Is that possible to do ? How ?
Thanks in advance
Regards
View 4 Replies
View Related
Aug 11, 2006
I am replicating using SQL Server 2000.
I have several merge agents which periodically fail due to locking contention. This is not a problem. The agent just runs again and is almost always successful, eventually.
I need a way to be alerted when the merge agent has failed three times consecutively.
Is there a way to do this?
View 1 Replies
View Related
Jan 10, 2007
is have this code, and i know that i have a record with the ID=1 but it will not show the data from the record..<asp:Content ID="Main" ContentPlaceHolderID="ContentPlaceHolderMain" Runat="Server">
<asp:FormView ID="form1" runat="server" DataSourceID="SqlDataSource1"></asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnStrAccess %>"
SelectCommand="SELECT [MainID], [MainText] FROM [SiteText] WHERE ([MainID] = ?)" ProviderName="<%$ ConnectionStrings:ConnStrAccess.ProviderName %>">
<SelectParameters>
<asp:SessionParameter DefaultValue="1" Name="SiteMainID" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
</asp:Content> Why can't it show the record !??
View 2 Replies
View Related
Aug 26, 2007
New to asp and have no idea what I'm doing wrong here. I just want to open a pdf that I have stored in a table and show it on the page. Here is my code. I keep getting the System.NullReferenceException was unhandled by user code.
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:smithsdaConnectionStringtest %>"
ProviderName="<%$ ConnectionStrings:smithsdaConnectionStringtest.ProviderName %>"
SelectCommand="SELECT * FROM [correspondence] WHERE ([facilitiesID] = ?)">
<SelectParameters>
<asp:QueryStringParameter Name="facilitiesID" QueryStringField="DACorr" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<script runat="server">Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim ScanDoc As New DataViewDim arg As New DataSourceSelectArguments
ScanDoc = SqlDataSource1.Select(arg)
Dim ScanLet(1) As ByteScanLet(0) = CByte(ScanDoc(0)("Letter"))
If ScanDoc IsNot "" Then
Response.Buffer = True
Response.Clear()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.BinaryWrite(ScanLet)
Response.End()
End IfEnd Sub
</script
Any Help greatly appreciated.
View 4 Replies
View Related
Dec 9, 2007
Hello!
I'm trying to show one large image and up to five small images. I can not get this to work. The five small images is in a repeater, the big picture is not in the repeater. I Think I just paste the code so you can look at it, i think that is better than me trying to explain moore:) I thougth I could use one of the events of the repeater and bind the large image when the page loads but I dont know what to use SqlDataSourceStatusEventArgs or what? I hope you all aunderstand whatI mean.<table style="background-color: #E4F9DF; margin: 10px 0px 0px 0px; border: 1px solid green;width: 545px; border-collapse: collapse;"><tr><td class="BoldText" colspan="2" style="border-bottom: 1px solid green; background-color: #b0eda2; text-align: center;">Bilder</td></tr><tr><td style="text-align:center"><asp:Image ID="Image1" Width="530px" runat="server" /></td></tr><tr><td> <asp:Repeater ID="Repeater1" OnItemCommand="imgBtnChangePic_Click" DataSourceID="sqlGetAdPics" runat="server"><ItemTemplate> The images will not appear, the shown like the path is wrong.<asp:ImageButton ID="ImageButton1" CommandName="changePic" ImageUrl='graphics/Advertise/<%#Eval("advertisePic")%>' CommandArgument='<%#Eval("advertisePic") %>' runat="server"/></ItemTemplate></asp:Repeater></td> </tr></table>
Here is the code behind
protected void Page_Load(object sender, EventArgs e){// this works, but I have to get the mage from the database...Image Image1 = (Image)DetailsView1.FindControl("Image1");Image1.ImageUrl = "graphics/Advertise/sadel2.jpg"; }protected void sqlGetAdDetails_Selected(object sender, SqlDataSourceStatusEventArgs e){if (e.Exception != null)lblError.Text = e.Exception.Message.ToString(); }protected void imgBtnChangePic_Click(object sender, RepeaterCommandEventArgs e){// This method is working.if (e.CommandName == "changePic" && Page.IsPostBack){Image Image1 = (Image)DetailsView1.FindControl("Image1");Image1.ImageUrl = "graphics/Advertise/" + e.CommandArgument.ToString();}}
View 6 Replies
View Related