1
Answer

SQL urgent need help

Rohit

Rohit

8y
278
1
this is my query 
 
with A as (select ClientID,CommunicationLogID,Fullname ,ContactDayID ,callForActivityID,ContactDirectionID,ContactDateTime,RANK() over(partition by ClientID order by ContactDateTime desc) as RNK from vwREClientCommunication)select * from A
where ContactDayID >=1887 and ContactDayID <=1887 And callForActivityID=1 and ContactDirectionID > 0
 
below is a table that return by above query
 
please focus on last coloumn  "RNK" which is i am getting wrong 
 
please help me where i am getting wrong after 1,2
 it should again started 1 but it getting 13,20 and something else 
 
 
 
 
ClientID CommunicationLogID ContactDayID callForActivityID ContactDirectionID ContactDateTime RNK
485 259837 1887 1 2 55:00.0 1
9001 259767 1887 1 2 39:59.0 2
9424 259727 1887 1 2 46:22.0 1
13736 259814 1887 1 2 10:25.0 1
22784 259875 1887 1 2 14:54.0 13
23996 259785 1887 1 2 54:54.0 20
24399 259833 1887 1 1 45:15.0 1
24449 259826 1887 1 2 32:29.0 1
28048 259860 1887 1 2 45:29.0 5
28048 259857 1887 1 2 43:02.0 6
32807 259746 1887 1 2 36:04.0 1
32807 259729 1887 1 2 54:24.0 2
32807 259716 1887 1 2 15:07.0 3
34541 259756 1887 1 2 10:13.0 2
36326 259791 1887 1 2 13:39.0 1
37530 259757 1887 1 1 12:20.0 12
37584 259771 1887 1 1 12:35.0 1
40028 259749 1887 1 2 43:35.0 8
41062 259824 1887 1 2 25:43.0 2
41551 259858 1887 1 2 43:26.0 2
42783 259907 1887 1 2 24:33.0 5
43161 259914 1887 1 2 43:53.0 7
 
 
Answers (1)
0
Administrator

Administrator

Admin 2.3k 1.3m 22y
Hi, To retrevie infromation from a usercontrol form from the save button which is in another user control what we can do is When the save button is clicked find the parent control of the save button, then using the parent control instance find out the form user control instance from that u can get the information. For example Let me have 2 user control the first user control the as an input as Name textbox and age textbox and another user control has an display button in another usercontrol To retervie the information and display when the display button is clicked private void btnDisplay_Click(object sender, System.EventArgs e) { //Finds out the panel control since the usercontrol is placed in a panel System.Web.UI.Control ct = this.Parent.FindControl("p1"); if(ct != null) { //Find out entry(form control) control System.Web.UI.Control ef = ct.FindControl("entry1"); if(ef != null) { //Find out the textbox control which is in form in turn which is place in a panel System.Web.UI.Control tb = ef.FindControl("txtName"); Response.Write(((TextBox)tb).Text); } else Response.Write("Entry form Box not found"); } else Response.Write("Control not found"); } If you want the entire program give me ur email id. Thanks edward prakash