Hi everybody...,Gudmorning to all
This is vishnuvardhan.i have a small dout.That is in my project i have one table that contains username psaaword and last chage date of password.here password is only change by administrator only.y because any error in password formate clint pointout us.Here userid password is use to login clint server.So we give rights to admin only to change all passwords.so here my problem is in admin window one link is ther.that is passwords need to change today.password need to change once in 30days irrespective on working days.total 30 days.I m unable to write SQL query for this.In thta window i have one datagridview.while picking that link the passwords appear which changed before 30 days from today date.Thais is my prob................? Any one Please help me to solve my problem..
Thanks in advance.
Loading
Suthish NairPosted Apr 14, 2011, 3:00 PM
CrishPosted Apr 13, 2011, 7:31 AM
http://www.axistechnolabs.com/technology/ecommerce-development.aspx
Rohatash KumarPosted Apr 13, 2011, 3:29 AM
For example, I've an Order table with a DateTime field called OrderDate. I want to retrieve all orders where the order date is equals to 01/01/2006. What's the best way?
- WHERE DateDiff(dd, OrderDate, '01/01/2006') = 0
- WHERE Convert(varchar(20), OrderDate, 101) = '01/01/2006'
- WHERE Year(OrderDate) = 2006 AND Month(OrderDate) = 1 and Day(OrderDate)=1
- WHERE OrderDate LIKE '01/01/2006%'
- WHERE OrderDate >= '01/01/2006' AND OrderDate < '01/02/2006'
- ...
In my opinion the best way in terms of performances is the 5WHERE OrderDate >= '01/01/2006' AND OrderDate < '01/02/2006'
Amit ChoudharyPosted Apr 13, 2011, 3:09 AM
Use the
function here the datepart can be days, month or years so you have to mention the days.
and startdate will be date of you have changed your password last time and the end date will be the +30 days of current date.
now you can check it for if 30 days are over or today is last date.
difference the todays date with end date. if the value is +ve then no need to show the link and if its -ve or 0 then show the link for change password.
Hope this make sense to you.
Thanks.