Click here to Skip to main content
15,896,111 members

sending sms for birthday and wedding day wish using loop else stmt

Revision 3
SQL
DOB    datetime 
WEdding datetime 

SQL
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) + "')";



sending sms for birthday and wedding day,

i have to use loop condition query apply and send the sms.

if year not equal to 1900 DONT send sms first to birthdaywish
then i use else stmt if year not equal to 1900 DONT send sms to wedding.
likewise
if year <> to 1900 send sms DOB date from database and send sms to birthday
then i use else stmt i year <> 1900 send sms to wedding.

i send the above query from the above query how to apply my else stmt.

please send the else loop stmt query from my above query.

please help me.

i want to write the query in from1.cs page
Posted 27-Dec-12 23:20pm by Member 8054539.
Tags: