narasiman rao

narasiman rao

  • NA
  • 519
  • 772.4k

semding sms for birthday wish and wedding day

Dec 28 2012 3:36 AM
 
 

 query as follows;

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

 
Database type as follows;

  DOB                  Datetime    
 Weddingdate           Datetime

i am sending sms for Birthday And Wedding.

i have following condition

when year in database DOB and Wedding date not equal(<>) to 1900 year message not be send.(fror the particular year 1900 message not be send)

when year in database DOB 4/2/1900 message not be send
When year in database Wedding  7/2/1900 message not be send.

when year in database DOB 28/12/1979 and Wedding date 6/7/2010 in that case birthday wish and Wedding date message both to be send at a time.

i send the query,from that query how to write my condition using else.using else send query for my above query.





Answers (1)