dcsimg

Search:

Type: Posts; User: Grand

Page 1 of 10 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    1
    Views
    146

    SQL - Unpivoting table in a specific manner

    Hi
    I cannot get my head around this challenge and I would appreciate if someone could help.
    I have a traceability table that logs every change that happens in each field. Now I would like to show...
  2. Re: SQL - some help with generating a matrix (pivot like)

    I see it now :)
    currently I don't have any course ID in Mentor_CM or any other places for that sake. The idea of generating unique ID for the course added by users is actually much cleaner and...
  3. Re: SQL - some help with generating a matrix (pivot like)

    OK, thanks.
    I have put the multiple conditions in the join query and it seems to do the job :)
    Also checked the tables and for some reason I actually created those table with primary keys. Example:...
  4. Re: SQL - some help with generating a matrix (pivot like)

    Thanks for the explanation.Currently there is only one record in that combination. However, users can add new module and courses where I didn't see the need to prevent them to create a course name...
  5. Re: SQL - some help with generating a matrix (pivot like)

    Yeah, unfortunately course name and description are not unique either. There can be some common course name in other modules; same goes for description. However, the combination of module name and...
  6. Re: SQL - some help with generating a matrix (pivot like)

    OK, let's go back one step :) I noticed that I get a different presentation of data compared to the actual data in table C.
    Those Xs (here MS) should look like the following, of course with all the...
  7. Re: SQL - some help with generating a matrix (pivot like)

    Thanks for the explanation. I got the math; but then what kind of aggregation shall I use if I need the value regardless of which alphabetic characters?
  8. Re: SQL - some help with generating a matrix (pivot like)

    Thanks, thanks, and thanks :)
    It worked, of course. I just put those things you mentioned together and used a temporary string of Inits for test; and it gave me the result I wanted:


    Select *...
  9. [RESOLVED] SQL - some help with generating a matrix (pivot like)

    Hi
    I need help with a query that generate a matrix as follows:

    - Take column 1 of Table A and use it as the rows for Matrix table
    - Take column 1 of Table B and use it as columns for matrix...
  10. Re: VB.net - Deleted directories remain there plus that they become inaccessible

    Thanks both for the explanation. I will check if the directory exist after "deletion". Also I will try to create a directory with the same name after the deletion just to check things out.
  11. Re: VB.net - Deleted directories remain there plus that they become inaccessible

    OK, Thanks for the info and cleaning up tips, it makes sense.

    I guess my statements are not chronologically structured.
    Before they are "deleted" at run time, I can delete them without any...
  12. VB.net - Deleted directories remain there plus that they become inaccessible

    Hi
    I am creating and deleting some directories via code. Creating is fine, but when I delete them, the the code runs fine (without error) but the directories are still there in Windows explorer...
  13. [RESOLVED] VB.net - issue with selecting a datatable multiple columns

    Hi
    I am trying to select two columns of a datatable but getting an error saying syntax error, missing operand after [Item Nr.]
    I have tried all I could but can't figure it out. How shall get the...
  14. Re: vb.net Problem with opening an Infopath file from My.Resources

    For the moment I just created a shared folder where everyone has access and put the templates there. Then just opened the file directly from that folder instead of going the other way of having them...
  15. Re: vb.net Problem with opening an Infopath file from My.Resources

    It makes sense :)
    Don't I need to write to a filestream first as I am doing above? If so, then .writeAllText is not a member of filestream. How else can I open the XML template?

    Edit
    OK, i was...
  16. [RESOLVED] vb.net Problem with opening an Infopath file from My.Resources

    Hi.
    I have been able to open pdfs from My.resources but for a limited period I need to let users to open some Info path templates (they are in XML format).

    I used this code to open my files:

    ...
  17. Re: [RESOLVED] SQL - Issue with local variable in a select query

    OK, I just realised that I can achieve the same thing just by building my string much much easier at client side and run it a sql query:

    Select * from
    (
    SELECT CM_JFIM As JFIM, module_code as...
  18. Re: SQL - Issue with local variable in a select query

    Hi
    Thanks for looking into this again. Yes, they are columns (fields) and they can vary based on user selections. They are actually values in column Emp_ID of CM_DMS table which then are pivoted to...
  19. Re: SQL - Issue with local variable in a select query

    This worked, thank you :)


    BEGIN
    DECLARE @cols AS NVARCHAR(MAX)='';
    DECLARE @query AS NVARCHAR(MAX)='';
    DECLARE @WhereInit AS NVARCHAR(MAX)= 'Where Emp_ID in (''ARML'',''TH'',''CBDI'')';...
  20. Re: SQL - Issue with local variable in a select query

    Thanks.
    I have tried it but it gives me this error:
    "An expression of non-boolean type specified in a context where a condition is expected, near ')'."
    It does not seem right to just write this...
  21. Re: SQL - Issue with local variable in a select query

    Thanks for the hint. The query being messy is my fault :)
    Printing reviled that @cols is empty.
    This gives me the result:


    SELECT @cols = @cols + QUOTENAME(Emp_ID) + ','
    FROM (SELECT...
  22. Re: SQL - Issue with local variable in a select query

    Hi
    Not when looking at the whole query though:

    (SELECT distinct Emp_ID FROM CM_DMS Where Emp_ID in (@WhereCols))

    I think it has something to do with the apostrophes in this? :

    DECLARE...
  23. [RESOLVED] SQL - Issue with local variable in a select query

    Hi
    I am preparing some dynamic stored procedures and while doing that am trying to use a variable in my query but I get an syntax error which I cannot figure out why and how:


    BEGIN
    DECLARE...
  24. Replies
    7
    Views
    514

    Re: SQL - Total in pivot table

    OK, it won't let me to type anything more than two lines. I will open a new thread.
    trying again...
    fully functioning also handling nulls:

    [CODE]DECLARE @cols NVARCHAR(MAX)=''
    DECLARE...
  25. Replies
    7
    Views
    514

    Re: SQL - Total in pivot table

    (
    SUM(ContOfUpdates) FOR Department IN (' + @cols + ')
    ) piv_Table
    SELECT * FROM #Tempy
    UNION ALL
    SELECT ''Total -->'' AS TOTAL...
  26. Replies
    7
    Views
    514

    Re: SQL - Total in pivot table

    Count(DocNr) AS ContOfUpdates
    From DMS_QDOC_AllUpdates
    Where Department in (Select Distinct Area From PhoneBookDMS)
    Group by Department,DocSubtype
    ) Origin
    ...
  27. Replies
    7
    Views
    514

    Re: SQL - Total in pivot table

    I can't post complete reply. Will try to post segmented.


    LEN(@COLS_SUM)) +' AS Total'

    --sum of single columns for vertically sum
    SELECT @COLS_TOT = @COLS_TOT +'SUM('+ QUOTENAME(Department) +...
  28. Replies
    7
    Views
    514

    Re: SQL - Total in pivot table

    OK, I got some progress (not checked rullup thing yet).
    Now there are only one issues: Horisontally, it only sums when all columns contain values (not null)
    I tried to use IsNull(Department, 0) but...
  29. Replies
    7
    Views
    514

    [RESOLVED] SQL - Total in pivot table

    Hi
    I have a query that gives me the sum of some stuff; and I need to have the total for each row to be presented in a new column called "Total" and also the total of each column be presented in a...
  30. Replies
    3
    Views
    366

    Re: VB.net Cursor and chart issue

    Thanks you both for trying to help.
    I also had the problem with Word and office interrupt thing and had to rename all my datatables to full system.data.datatable to differentiate them form Word...
  31. Replies
    3
    Views
    366

    [RESOLVED] VB.net Cursor and chart issue

    Hi
    I have a class that is being used to entertain the users for longer tasks:


    Public Class WaitCursor
    Implements IDisposable
    Public Sub New()
    ...
  32. Re: Issue with loading the form and jumping to a specific tabpage

    Cool, thanks for the explanation.
  33. [RESOLVED] Issue with loading the form and jumping to a specific tabpage

    I need to open a second form and show a specific tabpage when the form is loaded. I have defined a public variable and set that to the tabpage that I am interested to be opened when the form is...
  34. Replies
    7
    Views
    532

    Re: SQL - Between two dates issue

    Just wanted to thank again.
    Recreated the table with proper datatypes. Also as Sapator mentioned the date format had to be yyyy-mm-dd for it to work, I formatted the date in the Windows application...
  35. Replies
    7
    Views
    532

    Re: SQL - Between two dates issue

    This is the closest I can find to a version under property: 14.0.1000.169.
    Thank you both very much. I will apply the advice and will report back. I think I will probably recreate the whole table as...
  36. Replies
    7
    Views
    532

    Re: SQL - Between two dates issue

    Sorry about that, will keep that in mind in the future.
    The server says: Windows Server 2016 Standard (10.0)
    I noticed that the column DocApprovedDate is of type nvarchar example (21-08-2019...
  37. Re: [RESOLVED] Vb.net - Need some help with wrapping text in specific column of a dat

    So you mean that I have disrespect those who help here and read the post by not doing some search before I post my problem and so the insult I receive was well deserved. I get it but am not agree...
  38. Replies
    7
    Views
    532

    [RESOLVED] SQL - Between two dates issue

    Hi
    I am trying to get this thing to work but it seems that either the date format is not correct or I am doing some other things wrong or both.


    Select Top 10 Supplier, SUM([Count Of updates])...
  39. Re: Vb.net - Need some help with wrapping text in specific column of a datagirdview

    @techgnome
    OK, I got you. Sort of. At least on a general plan.
    I understand you but I don't agree with some of it. And I hope that I understand it wrong that you are implying that it is OK to...
  40. Re: SQL Join, manipulate and comma delimit column

    Hi
    I am trying your different suggestions.
    I was not sure that doing the calculation/manipulation on the client side is the way of doing it. Now, hearing it form the experts I am more confident.
    ...
Results 1 to 40 of 396
Page 1 of 10 1 2 3 4



Featured


Click Here to Expand Forum to Full Width