Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2011
    Posts
    2

    Unanswered: selecting order details with date feilds in where conditon

    Hi all,

    i am trying to run the following query

    SELECT o.orderNumber FROM [dbo].[Order] o WHERE (SELECT ose.Date AS dateofstatus FROM [Order]o
    JOIN dbo.OrderStatusEntry AS OSE ON OSE.Order_id=o.ID
    WHERE ose.StatusTo IN ('Audited','Waiting')) >= (SELECT ose.Date AS dateofstatus FROM [Order]o
    JOIN dbo.OrderStatusEntry AS OSE ON OSE.Order_id=o.ID
    WHERE ose.StatusTo IN ('Audited','Waiting'))


    regards
    jk

  2. #2
    Join Date
    Sep 2011
    Posts
    2
    [QUOTE=jakdb;6519250]Hi all,

    i am trying to run the following query

    SELECT o.orderNumber FROM [dbo].[Order] o WHERE (SELECT ose.Date AS dateofstatus FROM [Order]o
    JOIN dbo.OrderStatusEntry AS OSE ON OSE.Order_id=o.ID
    WHERE ose.StatusTo IN ('Audited','Waiting')) >= (SELECT ose.Date AS dateofstatus FROM [Order]o
    JOIN dbo.OrderStatusEntry AS OSE ON OSE.Order_id=o.ID
    WHERE ose.StatusTo IN ('Audited','Waiting'))

    You can find the explanation below link

    Select Query using date part
    regards
    jk[/Please find the explation of requirment in below link
    http://social.msdn.microsoft.com/For...-999b90655ae3]

  3. #3
    Join Date
    Sep 2011
    Posts
    75
    Hello,

    What is the problem in the query? If it s date comparision issue then you need to convert the date to 101 format

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •