Click here to Skip to main content
15,501,276 members
Home / Discussions / Database
   

Database

 
QuestionThe Log For the Database is Not Available Pin
Prakash S19-Jul-14 1:58
MemberPrakash S19-Jul-14 1:58 
AnswerRe: The Log For the Database is Not Available Pin
Andrius Leonavicius19-Jul-14 14:40
professionalAndrius Leonavicius19-Jul-14 14:40 
GeneralRe: The Log For the Database is Not Available Pin
Prakash S20-Jul-14 21:08
MemberPrakash S20-Jul-14 21:08 
GeneralRe: The Log For the Database is Not Available Pin
Andrius Leonavicius21-Jul-14 4:01
professionalAndrius Leonavicius21-Jul-14 4:01 
AnswerRe: The Log For the Database is Not Available Pin
Kornfeld Eliyahu Peter19-Jul-14 23:54
professionalKornfeld Eliyahu Peter19-Jul-14 23:54 
QuestionHow to select persons who didn't pay they'r bill for two mounth Pin
mohammadkaab18-Jul-14 6:57
Membermohammadkaab18-Jul-14 6:57 
AnswerRe: How to select persons who didn't pay they'r bill for two mounth Pin
Richard MacCutchan18-Jul-14 7:32
mveRichard MacCutchan18-Jul-14 7:32 
AnswerRe: How to select persons who didn't pay their bill for two months Pin
Richard Deeming18-Jul-14 7:49
mveRichard Deeming18-Jul-14 7:49 
Assuming that one person can have multiple payments, an INNER JOIN will return a record for every payment over two months old, regardless of whether the person has paid within the last two months.

What you need to do is find the person records which don't have a payment record within the last two months. To do that, you can use a Not Exists filter:
SQL
DECLARE @Today date = GetUtcDate();
DECLARE @CutoffDate date = DateAdd(month, -2, @Today);

SELECT
    *
FROM
    person
WHERE
    Not Exists
    (
        SELECT 1
        FROM payment
        WHERE payment.national_number = person.national_number
        And payment.payment_date > @CutoffDate
    )
;




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: How to select persons who didn't pay their bill for two months Pin
PIEBALDconsult18-Jul-14 8:47
professionalPIEBALDconsult18-Jul-14 8:47 
GeneralRe: How to select persons who didn't pay their bill for two months Pin
Richard Deeming18-Jul-14 8:52
mveRichard Deeming18-Jul-14 8:52 
AnswerRe: How to select persons who didn't pay they'r bill for two mounth Pin
Eddy Vluggen18-Jul-14 7:49
professionalEddy Vluggen18-Jul-14 7:49 
GeneralRe: How to select persons who didn't pay they'r bill for two mounth Pin
Mycroft Holmes18-Jul-14 15:49
professionalMycroft Holmes18-Jul-14 15:49 
AnswerRe: How to select persons who didn't pay they'r bill for two mounth Pin
PIEBALDconsult18-Jul-14 8:42
professionalPIEBALDconsult18-Jul-14 8:42 
Questionhow to select numbers (integers) only? Pin
Jassim Rahma16-Jul-14 23:52
MemberJassim Rahma16-Jul-14 23:52 
AnswerRe: how to select numbers (integers) only? Pin
Richard MacCutchan16-Jul-14 23:54
mveRichard MacCutchan16-Jul-14 23:54 
AnswerRe: how to select numbers (integers) only? Pin
thatraja17-Jul-14 0:01
professionalthatraja17-Jul-14 0:01 
AnswerRe: how to select numbers (integers) only? Pin
Mycroft Holmes17-Jul-14 13:49
professionalMycroft Holmes17-Jul-14 13:49 
AnswerRe: how to select numbers (integers) only? Pin
PIEBALDconsult17-Jul-14 14:52
professionalPIEBALDconsult17-Jul-14 14:52 
GeneralRe: how to select numbers (integers) only? Pin
Jassim Rahma19-Jul-14 23:17
MemberJassim Rahma19-Jul-14 23:17 
GeneralRe: how to select numbers (integers) only? Pin
PIEBALDconsult20-Jul-14 5:50
professionalPIEBALDconsult20-Jul-14 5:50 
QuestionHandle to chat room with mysql database Pin
Member 1094998616-Jul-14 5:08
MemberMember 1094998616-Jul-14 5:08 
AnswerRe: Handle to chat room with mysql database Pin
Eddy Vluggen16-Jul-14 6:02
professionalEddy Vluggen16-Jul-14 6:02 
GeneralRe: Handle to chat room with mysql database Pin
Member 1094998616-Jul-14 8:18
MemberMember 1094998616-Jul-14 8:18 
GeneralRe: Handle to chat room with mysql database Pin
Eddy Vluggen16-Jul-14 8:46
professionalEddy Vluggen16-Jul-14 8:46 
GeneralRe: Handle to chat room with mysql database Pin
Member 1094998616-Jul-14 8:53
MemberMember 1094998616-Jul-14 8:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.