Click here to Skip to main content
12,693,254 members (31,932 online)

BIrthday and Wedding day sms

Member 8054539 asked:

Open original thread
Sql = "select s.Name,s.DOB,s.Mobileno,s.Weddingday from BirthDayWish s where s.Active <> 'D'";
Sql = Sql + " and (month(DOB) = month('"+ Convert.ToDateTime(CurDate) + "') and day(DOB) = day ('" + Convert.ToDateTime(CurDate) + "'))";

Sql = Sql + " or (month(Weddingday) = month('" + Convert.ToDateTime(CurDate) + "')  and  day(Weddingday) = day ('" + Convert.ToDateTime(CurDate) + "'))";

in the above query condition day and month fall that year birthdaysms be sent
and also day and month fall that year wedding sms be sent.

it is not conditon both day and month fall of birthday and wedding need not be like that.

Database column as follows;

name      DOB          Mobileno       weddingday

Ramesh    11/12/2013   9840576895      1/1/2035.
          (MM/DD/YYYY)                (MM/DD/YYYY)

in that when i send sms only wedding day sms only to be send.

but when i send sms to this number both birthday and wedding day sms has sent at a time.

because in birthday 11/12/2013 i send sms on today(1.1.2013) to this number(9840576895) only birthdaay falls on 11 dec 2013.

but birthday sms sent why.

only wedding sms to be send.

from the above query wat is the problem help me.

[edit]Code block added - OriginalGriff[/edit]
Tags: C#


When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the The Code Project Open License (CPOL).

Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 26 Mar 2009
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100