Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. northw

    Cumulative Calculation

    Hi All, I have a question regarding cumulative calculation where I want to calculate row by row Invoice and Payment. Here is the sample data and my desired output. Cust/Month/Trans/Amount/CumulativeBal(my desired output) 1, 1, Due, 100, 100 1, 1, Payment, 50, 50 1, 1, Payment, 50, 0 1, 2...
  2. northw

    how to concatenate fields

    try this: SELECT DISTINCT oq.id , STUFF((SELECT ' ' + inq.note AS [text()] FROM #Test inq WHERE inq.id = oq.id FOR XML PATH('')), 1, 1, '')AS qt FROM #Test oq;
  3. northw

    sequential data selection

    Updated ddl create table #test (ID int, Text varchar(10)) insert into #test select 1, 'ab' union all select 1, 'ab' union all select 2, 'cd' union all select 2, 'df' union all select 3, 'ab' union all select 3, 'cd' union all select 3, 'df' union all select 4, 'xy' union all select 4, 'xy'...
  4. northw

    sequential data selection

    Tamar, There can be more than two records, same thing applies if all the records with same ID matched then it has to be matched or else unmatched. Thanks!
  5. northw

    sequential data selection

    Hi All, how to identify different fields with in a group of records? Example: create table #test (ID int, Text varchar(10)) insert into #test select 1, 'ab' union all select 1, 'ab' union all select 2, 'cd' union all select 2, 'df' select * from #test I want to show additional field as...
  6. northw

    select depart and arrival cities

    Thank you Ryan! worked like a charm!
  7. northw

    select depart and arrival cities

    Hi George, Thanks for the reply, I am an analyst, with basic sql knowledge. This is not something for class.
  8. northw

    select depart and arrival cities

    Code has some errors, here is the edited: CREATE TABLE #XY123 ( tktamt MONEY, departcty VARCHAR(5), arrivalcty VARCHAR(5), tktnum INT ) INSERT INTO #XY123 SELECT '100.00', 'DFW', 'LGA', 12345 UNION ALL SELECT '120.00', 'MIA'...
  9. northw

    select depart and arrival cities

    Hi all, I have a question regarding the selection of arrival and departure city. CREATE TABLE #XY123 ( tktamt MONEY, departcty VARCHAR(5), arrivalcty VARCHAR(5), tktnum INT ) INSERT INTO #XY123 SELECT '100.00', 'DFW', 'LGA', 12345 UNION...
  10. northw

    Production change approach

    Hi All, I need your valuable inputs about the production change in our database that is affecting reports, the application team has introduced an additional field to the tables in our database, with addition of that field we have to add an additional join condition and there are around 200...
  11. northw

    Group selection

    Hi All, I have groupings in my report, one of the groupings is preferred clients which has all the customers and some elite customers, which can be identified based on the elite phone num field if it is null or not, determines a elite customer, I have top 15 clients for which I want to display...
  12. northw

    Pie chart with Value and Percent

    Hi All, I am using Crystal 2011, is there a way to display Value and percentage on the pie chart, I can see the option to display it in the legend, but not next to the pie's, I can just display either value or percent but not both. Thanks for the help!
  13. northw

    First working day of the month

    Thanks Chris and Carp! SQL statement solution worked perfectly, and gave me exactly what I wanted. Any suggestion for the same thing for a week, date before last five business days, if it is holiday/saturdat/Sunday, then get the day before it. I wrote this, but want to know if it can be...
  14. northw

    First working day of the month

    Hi All, Can this query be further shrinked/optimized? I am getting here the first working day of the month. xxwfs_get_work_day is a function based on a holiday table which returns "1" for a federal holiday, "2" for saturday and sunday and "0" for a working day. SELECT (CASE WHEN...
  15. northw

    Crosstab query.

    Thanks Peter!
  16. northw

    Query help.

    Thanks Carp!
  17. northw

    Query help.

    Hi all, I have these two queries below, I want to substract the qty from the first query from the second, and display the result, what would be the approach I should take? SELECT pos.trade_num, pos.time_period_cd, mkt.quote_def_cd, SUM (qty) FROM pos_20130729...
  18. northw

    Crosstab query.

    Hi all, I have these two queries below, I want to substract the qty from the first query from the second, and display in a cross tab, what would be the approach I should take? SELECT pos.trade_num, pos.time_period_cd, mkt.quote_def_cd, SUM (qty) FROM...
  19. northw

    Month value dynamically default to current month

    Thanks Mike and PeterDimitrov! I just wanted to make sure that it cannot be done as peter said with out third party viewer, I can try Mike's solution, but the users here are very particular, when they say they want see the month, they mean it they will not take any workaround. Thanks again!
  20. northw

    Month value dynamically default to current month

    Thanks Mike for the reply, I think I did not explain it correctly, the requirement is if the users open the report in June they should see Jun as the default value, in July it should be JUL and so on.. as far as I know I can enter a value for the default, but I am not sure how to make that...

Part and Inventory Search

Back
Top