May 27, 2018 at 10:44 am
Hi
I have below Data .
Date | Amount | Location | Posted Date | Posted Amount | Camount | Status |
01/10/2017 | 3,400.00 | AMB | 0 | 0 | Open | |
03/10/2017 | 2,100.00 | AMB | 0 | 2,100.00 | Open | |
04/10/2017 | 4,801.00 | AMB | 0 | 4,801.00 | Open | |
05/10/2017 | 8,577.00 | AMB | 0 | 0 | Open | |
07/10/2017 | 500 | AMB | 0 | 0 | Open | |
08/10/2017 | 17,360.00 | AMB | 0 | 0 | Open | |
03/10/2017 | 0 | AMB | 03/10/2017 | 2,000.00 | 2,100.00 | Closed |
04/10/2017 | 0 | AMB | 04/10/2017 | 4,801.00 | 4,801.00 | Closed |
03/10/2017 | 0 | AMB | 05/10/2017 | 100 | 2,100.00 | Closed |
I want to display those records which have Status Open and their records with Status = 'Posted. . For e.g in below data like this
Date | Amount | Location | Posted Date | Posted Amount | Camount | Status |
01/10/2017 | 3,400.00 | AMB | 0 | 0 | Open | |
03/10/2017 | 2,100.00 | AMB | 0 | 2,100.00 | Open | |
03/10/2017 | 0 | AMB | 03/10/2017 | 2,000.00 | 2,100.00 | Closed |
03/10/2017 | 0 | AMB | 05/10/2017 | 100 | 2,100.00 | Closed |
04/10/2017 | 4,801.00 | AMB | 0 | 4,801.00 | Open | |
04/10/2017 | 0 | AMB | 04/10/2017 | 4,801.00 | 4,801.00 | Closed |
05/10/2017 | 8,577.00 | AMB | 0 | 0 | Open | |
07/10/2017 | 500 | AMB | 0 | 0 | Open | |
08/10/2017 | 17,360.00 | AMB | 0 | 0 | Open |
Thanks
May 27, 2018 at 12:13 pm
select Date ,Amount, Location, [Posted Date], [Posted Amount], Camount,Status
from Tablename
where status ='posted'
***The first step is always the hardest *******
May 27, 2018 at 4:03 pm
jagjitsingh - Sunday, May 27, 2018 10:44 AMHi
I have below Data .
Date Amount Location Posted Date Posted Amount Camount Status 01/10/2017 3,400.00 AMB 0 0 Open 03/10/2017 2,100.00 AMB 0 2,100.00 Open 04/10/2017 4,801.00 AMB 0 4,801.00 Open 05/10/2017 8,577.00 AMB 0 0 Open 07/10/2017 500 AMB 0 0 Open 08/10/2017 17,360.00 AMB 0 0 Open 03/10/2017 0 AMB 03/10/2017 2,000.00 2,100.00 Closed 04/10/2017 0 AMB 04/10/2017 4,801.00 4,801.00 Closed 03/10/2017 0 AMB 05/10/2017 100 2,100.00 Closed I want to display those records which have Status Open and their records with Status = 'Posted. . For e.g in below data like this
Date Amount Location Posted Date Posted Amount Camount Status 01/10/2017 3,400.00 AMB 0 0 Open 03/10/2017 2,100.00 AMB 0 2,100.00 Open 03/10/2017 0 AMB 03/10/2017 2,000.00 2,100.00 Closed 03/10/2017 0 AMB 05/10/2017 100 2,100.00 Closed 04/10/2017 4,801.00 AMB 0 4,801.00 Open 04/10/2017 0 AMB 04/10/2017 4,801.00 4,801.00 Closed 05/10/2017 8,577.00 AMB 0 0 Open 07/10/2017 500 AMB 0 0 Open 08/10/2017 17,360.00 AMB 0 0 Open Thanks
Not entirely sure what you mean (from your data) what you mean by "posted". Does that mean a non-null Date Posted?
If that's the case then your WHERE clause is something like WHERE [Status] = 'Open' AND [Posted Date] IS NOT NULL;
May 27, 2018 at 10:25 pm
Hi
I want those records which have Status Open and their Amount - CAmount <> 0 then with Open record i want to display that Date Posted records. In my case Date 03/10/2017 has 3 records & date 04/10/2017 but their Amount - CAmount = 0 in their Open Status so they should not be displayed. It should display all other records.
Thanks
May 28, 2018 at 2:32 am
select Date ,Amount, Location, [Posted Date], [Posted Amount], Camount,Status
from Tablename
where status ='posted'
and [Posted Amount] - Camount !=0
***The first step is always the hardest *******
May 30, 2018 at 4:35 pm
SELECT [Date], Amount, Location, [Posted Date], [Posted Amount], Camount, [Status]
FROM MyTable
WHERE [Status]='Open' AND Amount - CAmount <> 0;
June 3, 2018 at 11:03 am
jagjitsingh - Sunday, May 27, 2018 10:44 AMHi
I have below Data .
Date Amount Location Posted Date Posted Amount Camount Status 01/10/2017 3,400.00 AMB 0 0 Open 03/10/2017 2,100.00 AMB 0 2,100.00 Open 04/10/2017 4,801.00 AMB 0 4,801.00 Open 05/10/2017 8,577.00 AMB 0 0 Open 07/10/2017 500 AMB 0 0 Open 08/10/2017 17,360.00 AMB 0 0 Open 03/10/2017 0 AMB 03/10/2017 2,000.00 2,100.00 Closed 04/10/2017 0 AMB 04/10/2017 4,801.00 4,801.00 Closed 03/10/2017 0 AMB 05/10/2017 100 2,100.00 Closed I want to display those records which have Status Open and their records with Status = 'Posted. . For e.g in below data like this
Date Amount Location Posted Date Posted Amount Camount Status 01/10/2017 3,400.00 AMB 0 0 Open 03/10/2017 2,100.00 AMB 0 2,100.00 Open 03/10/2017 0 AMB 03/10/2017 2,000.00 2,100.00 Closed 03/10/2017 0 AMB 05/10/2017 100 2,100.00 Closed 04/10/2017 4,801.00 AMB 0 4,801.00 Open 04/10/2017 0 AMB 04/10/2017 4,801.00 4,801.00 Closed 05/10/2017 8,577.00 AMB 0 0 Open 07/10/2017 500 AMB 0 0 Open 08/10/2017 17,360.00 AMB 0 0 Open Thanks
Please see the article at the first link in my signature line below under "Helpful Links" for future posts.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply