Search

You searched for the word(s): userid:875965

Matching Posts

  • Show/Hide/Submit

    Hello I have a wired problem. I have a hidden area for input. The user must press a button called Show Insert to show the hidden area. In the input area I am using a CompareValidator. I need the user to be able to cancel the input process, so, I have a cancel button. If the user pressed the cancel button while the message of the CompareValidator is appearing, and then pressed the Show Insert to show the input screen again, nothing happens!!! Note: Pressing Cancel/Show Insert as many times while the
    Posted to Web Forms (Forum) by Noorstudio on 12/16/2009
  • Re: Select distinct

    Hello Limno, I just noticed something on the output (first column is correctly displayed) . I hope you can help me displaying first column with its correct year and month. Select distinct ConsumptionKWH ,Max(ConsumptionYear) ConsumptionYear, Max(ConsumptionMonth) as ConsumptionMonth from PeriodicConsumptions WHERE (MeterNo='03807451') group by ConsumptionKWH Select ConsumptionKWH , ConsumptionMonth, ConsumptionYear from PeriodicConsumptions WHERE (MeterNo='03807451' AND ConsumptionYear
  • Re: Select distinct

    Thank you all for dropping by. I tried them all but Limno's 1st suggestion worked best for me. Limno, I would appreciate it if you could explain to me why you used Max() function on the other two fields and did not use distinct on ConsumptionKWH field? Thanks
  • Select distinct

    Hello. What's wrong on my query that I am getting similar numbers?? Select distinct (ConsumptionKWH ),ConsumptionYear, ConsumptionMonth from PeriodicConsumptions WHERE AccountNo = '0000' Result is: 10000 2009 1 10000 2009 4 10000 2010 9 20000 2009 2 20000 2009 3 30000 2010 3 30000 2011 8 40000 2009 11 40000 2011 11 50000 2010 11 60000 2010 10 60000 2011 3 70000 2011 5 Thanks
  • Using GetOrdinal() method of a DataReader object

    Hello, How to be able to use the F2 field found in table2 to get the data? If reader.HasRows Then Dim newListItem As New ListItem Dim F2 As Integer = reader.GetOrdinal("F2") While reader.Read newListItem.Text = Reader.GetString(reader.GetOrdinal("F2")) LBMin.Items.Add(newListItem) End While End If It gives an error that is not parsed. Thanks
  • Re: Using GetOrdinal() method of a DataReader object

    Hello, I don't have problem working with a DataReader and getting the DATA using one table. The problem is getting the DATA using two tables. That is : a field from Table2. Thanks
  • Re: Retreiving last N updated records

    Hello Steelymar . Thank you very much for your help. That's solved the problem. I just added the AS alias into the query. The following is the complete query for those who are interested. SELECT * from (SELECT top 12 MeterReadings.MeterNo, MeterReadings.LastKWH, MeterReadings.AccountNo, MeterReadings.MultiplyFactor, MeterReadings.LastReading, MeterReadings.ThisMonthReading, MeterReadings.NumberofDays, MeterReadings.ReadingGYear, MeterReadings.ReadingGMonth, MeterReadings.ReadingDate, PeriodicConsumptions
  • Retreiving last N updated records

    Hello, I am retreiving last 12 updated records by date (ReadingDate) but not able to add a field from another table. If I add a field from another table in the first SELECTION, I will NOT get the same result, why? How to fix it? As you noticed, the name of the field and its table is commented out. Here is my query: SELECT MeterReadings.MeterNo, MeterReadings.LastKWH, MeterReadings.AccountNo, MeterReadings.MultiplyFactor, MeterReadings.LastReading, MeterReadings.ThisMonthReading, MeterReadings.NumberofDays
  • Re: Retreiving last N updated records

    Thank you for dropping by. Yes, what you did is a normal query that will retrieve/grab top 12 records after having descending order . Actually, in my query, I am having two selects so I can have the result of the sub-query to be listed in the order I want. The way the records are to be displayed on screen of my application is very important. They have to be in ascending order. That is, I am trying reordering the result of a normal query. Any suggestions? Thanks
  • Re: Retreiving last N updated records

    Hello Steelymar I tried your query, it did not work, it gives an error. The error returns from SQL SERVER is the following: Msg 156, Level 15, State 1, Line 19 Incorrect syntax near the keyword 'ORDER'. I triedIs it possible to have a query that just takes the result from a sub query just like what you did? Is it possible to have a query that just takes the result from a sub query just like what you did? No alias of the tables? Thanks
Page 1 of 5 (45 items) 1 2 3 4 5 Next >