this is the customers table, column 'C\_BillingDay' indicates on which day the bill are due monthly for example if value is 4 thn billing due date of that customer is 4rth of each month. he has to pay his dues on 4rth ..

```
CREATE TABLE [dbo].[Customers](
 [CID] [int] IDENTITY(1,1) NOT NULL,
 [C_Name] [varchar](50) NULL,
 [C_EmailID] [varchar](20) NULL,
 [C_MobileNo] [varchar](20) NULL,
 [C_PhoneNo] [varchar](20) NULL,
 [C_HomeAddress] [varchar](max) NULL,
 [C_ServiceArea] [int] NULL,
 [C_AccountStatus] [int] NULL,
 [C_IPAdress] [varchar](50) NULL,
 [C_MACAddress] [varchar](50) NULL,
 [C_Package] [int] NULL, 
 [C_BillingDay] [int] NULL,
 [Balance] [float] NULL, 
 [C_AccountCreated] [datetime] NULL,
 [C_AccountModified] [datetime] NULL,

```

payments' table:

```
TABLE [dbo].[Payments](
    [PID] [int] IDENTITY(1,1) NOT NULL,
    [CID] [int] NULL,
    [Amount] [int] NULL,
    [PaymentType] [int] NULL,
    [Details/Comments] [varchar](max) NULL,
    [DateTimeRecieved] [datetime] NULL,
    [DateTimeModified] [datetime] NULL,

```

please help me quering all the defaulters who have not paid their dues on time by today ...

i have been trying with similar functions like DATEADD(MONTH,-1,GETDATE()) but they are not giving desired results :S

```
select * from Customers,payments 
 where Payments.DateTimeRecieved 
NOT BETWEEN GETDATE() AND DATEADD(MONTH,-1,GETDATE())

```