none
Please i need help with writing up a Tsql query using the logic below RRS feed

  • Question

  • please i'm new to sql and i got this business requirement to come up with query for reporting.

    i'm thinking is going to be a giant case statement, the status is going to be hard coded and if each bucket logic falls under that status then pull in LastWorkflowStatus Change Date 

    use '1/1/1900' for No receivedDate 

    Column names are: ActionDefID, sentdate, receiveddate, FileID

    Table Name: dbo.FileActions

    BELOW IS THE DETAIL LOGIC:


    • Edited by ronaldo20 Thursday, March 5, 2020 6:20 PM
    Friday, February 28, 2020 6:53 PM

Answers

All replies

  • Please post your table structure in DDL script;

    Use insert scripts to post your sample data;

    Let us know your expected result from your sample data (a tabular format will help).

    Thanks.

    Friday, February 28, 2020 7:16 PM
    Moderator
  • Hi ronaldo20, 

    Welcome to Transact-SQL Forum . 

    Could you  please share us your table structure and some sample data along with your expected result? So that we’ll get a right direction and make some test.

     

    Best Regards,

    Rachel


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 2, 2020 4:46 AM
  • i was able to figure it out, thanks a lot. 
    Thursday, March 5, 2020 6:22 PM
  • i was able to figure it out, thanks a lot. 
    Thursday, March 5, 2020 6:22 PM
  • Hi ronaldo20,

     

    Thank you for your reply.

     

    We are glad to hear that  you have solved your issue ,please kindly mark the helpful replies or your own reply as answers. By doing so, it will benefit all community members who are having this similar issue.  Your contribution is highly appreciated.

     

    Best Regards,

    Rachel


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, March 6, 2020 6:12 AM
  • Hi ,

     

    I am writing to follow up this thread with you. Have you solved your issue? If you have solved your issue ,in order to close this thread, please kindly mark helpful replies as answers. By doing so, it will benefit all community members who are having this similar issue.  Your contribution is highly appreciated.

     

    Best Regards,

    Rachel


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 9, 2020 7:51 AM