But its better not to use the below code in custumization, unless for a "Job".
Belujins method is recommended.
stuzimmy <[EMAIL PROTECTED]> wrote: The following code will find users
who's month and day match today's
month and day. It runs a sql statement against the database.
Good luck.
Connection Con = new Connection();
Statement Stmt = Con.createStatement();
ResultSet R = Stmt.executeQuery("SELECT Name,BirthDate from
EmplTable where month(EmplTable.BirthDate) = month(GetDate()) and day
(EmplTable.BirthDate) = day(GetDate())");
;
while ( R.next() )
{
print R.getString(1);
pause;
}
--- In [email protected], "Max Belugin"
<[EMAIL PROTECTED]> wrote:
>
> Add month and day fields and index and update them when birthdate
changes
>
>
> On 11/1/07, Ali Ãhsan Aðca <[EMAIL PROTECTED]> wrote:
> > Thanks Steffen,
> > But I wrote wrong word in my reply message to Rosyee.
> > Sufficient must be efficient.
> > I know that query will bring me the result but speed will not
> > be high as I wish.
> > Because all the records will be checked if the person is born
today in
> > code.
> > But I want that case be checked by sql server not by axapta.
> > Glad to describe my problem to you. (If I could)...
> >
> > Best Regards...
> > Ali Ihsan
> >
> > --- In [email protected], "Steffen Denize"
> > <steffendenize@> wrote:
> > >
> > > Hi Ali
> > >
> > > If you change emplTable to contactPerson in the select statement
> > from Rosyee
> > > you will find all persons who have birthday today, no matter how
> > many person
> > > there are in the given table.
> > >
> > >
> > >
> > > Best regards,
> > >
> > > Steffen
> > >
> > >
> > >
> > > Fra: [email protected]
> > > [mailto:[EMAIL PROTECTED] PÃ¥ vegne af Ali
Ãhsan Aðca
> > > Sendt: 24. oktober 2007 12:52
> > > Til: [email protected]
> > > Emne: [development-axapta] Re: How To Find Persons who born
today ?
> > > (birthdate)
> > >
> > >
> > >
> > > Thanks Rosyee,
> > > But I have to find persons from ContactPerson table.
> > > And there more than 200.000 records in there.
> > > And this method will not be sufficient for finding 5 or maybe
max 10
> > > person from there.
> > >
> > > Best Regards...
> > > --- In HYPERLINK
> > >
> > "mailto:development-axapta%40yahoogroups.com"development-
[EMAIL PROTECTED]
> > > com, Rosyee <rosyee@> wrote:
> > > >
> > > > Hi Ali,
> > > >
> > > > You can use like this
> > > >
> > > > while Select emplTable
> > > > {
> > > > if( mthofyr(emplTable.BirthDate) == mthofyr(today())
> > > > && dayofmth(emplTable.BirthDate) == dayofmth(today()))
> > > > {
> > > > //u'll get records who born on same day as today
> > > > }
> > > > }
> > > >
> > > > Hope this is what you are looking for.
> > > >
> > > > Thanks,
> > > > Rosyee
> > > >
> > > >
> > > > On 10/24/07, Max Belugin <mbelugin@> wrote:
> > > > >
> > > > > I'd prefer to extract month and day numbers to separate
fields.
> > > > >
> > > > > But you can use Connection and native queries
> > > > >
> > > > > On 10/23/07, Ali Ãhsan Aðca
> > > <aliihsanagca@<aliihsanagca%40gmail.com>>
> > > > > wrote:
> > > > > > I thought so. But I think there must be a way to include
that
> > > case in
> > > > > > query filter string
> > > > > >
> > > > > > Thanks...
> > > > > >
> > > > > > --- In
> > > HYPERLINK
> > >
> > "mailto:development-axapta%40yahoogroups.com"development-
[EMAIL PROTECTED]
> > > com<development-axapta%40yahoogroups.com>,
> > > > > "Max Belugin"
> > > > > > <mbelugin@> wrote:
> > > > > > >
> > > > > > > I think, the only way is to enumerate dates from today
back to
> > > 1900.
> > > > > > > (AFAIK there is no way to store dates prior to 1900)
> > > > > > >
> > > > > > > On 10/22/07, Ali �hsan Aðca <aliihsanagca@>
wrote:
> > > > > > > > I want to find the persons who were born today?
> > > > > > > > What is the filter for that query?
> > > > > > > >
> > > > > > > > Thanks in advance...
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Yahoo! Groups Links
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Max Belugin, HYPERLINK
> > "http://belugin.info"http://belugin.info ,
> > > ICQ:9406811
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Yahoo! Groups Links
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > > --
> > > > > Max Belugin,
HYPERLINK "http://belugin.info"http://belugin.info ,
> > > ICQ:9406811
> > > > >
> > > > >
> > > >
> > > >
> > > > [Non-text portions of this message have been removed]
> > > >
> > >
> > >
> > >
> > >
> > >
> > > No virus found in this incoming message.
> > > Checked by AVG Free Edition.
> > > Version: 7.5.503 / Virus Database: 269.15.9/1090 - Release Date:
> > 24-10-2007
> > > 08:48
> > >
> > >
> > > No virus found in this outgoing message.
> > > Checked by AVG Free Edition.
> > > Version: 7.5.503 / Virus Database: 269.15.9/1090 - Release Date:
> > 24-10-2007
> > > 08:48
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>
>
> --
> Max Belugin, http://belugin.info , ICQ:9406811
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[Non-text portions of this message have been removed]