Link to home
Start Free TrialLog in
Avatar of Sha1395
Sha1395

asked on

Date Range in Active Directory

I was trying to find some example to retrieve user based on Date Range.

For Eg: if i give a date like 1/01/2011 to 31/01/2011 in my windows application.

I wanna retrieve the user info , created on these date ranges.

For Eg: User Bob Created on 15/01/2001,then i have to retrieve that user name.

but am not sure what's the "Search Filter" for that.

Any help appreciated
Avatar of ramkihardy
ramkihardy

HI,
    get the dates entered by the user and convert it to datetime....
like this
Get the Date from the two date fields and convert them to DateTime by using Convert.ToDateTime(DateFiledValue) write a query like this
string SQL=Select Username from UserMst where name='Bob' and Created on between 'Converted From Date Field Value ' AND 'Converted To Date Field Value'.....
This query will give the desired result............
If Any Help please Let me know...
Mark it as answer if it is helpful...
With Regards



Avatar of Sha1395

ASKER

Hi Ramki,

Am not querying SQL,i havey to Query Active Directory.
ASKER CERTIFIED SOLUTION
Avatar of ramkihardy
ramkihardy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sha1395

ASKER

Thanks Ramki,

I checked codeproject,none of them give an example or syntax for "date range" search filter.

I can't use Sql Server,bcoz my requirement is to write a Class Library file (DLL) on C#.

Appreciated for your help
SOLUTION
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial