troubleshooting Question

6 months (date) query

Avatar of eaweb
eawebFlag for undefined asked on
DatabasesMicrosoft SQL ServerSQL
10 Comments2 Solutions260 ViewsLast Modified:
hi, i have a table named ctrack in which i keep track of a client's last login time

i am in need of a query where i can use the number of days like (180) that can pull out the clients that haven't login for the last 6 months
the date count must begin from the actual date (today). if i can put the date from where to begin and how many days afetr i want to view (180) would be fine


client_id      Last_Login_Time
1            3/8/2007 10:07:43 AM
2            11/7/2007 9:45:44 AM
3            <null>
4            11/7/2007 12:34:12 PM
5            11/7/2007 12:10:23 PM
6            11/7/2007 4:35:19 PM
7            9/16/2005 11:25:39 AM
8            4/26/2007 2:15:56 PM
9            10/9/2007 4:37:40 PM
10            8/6/2003 9:19:52 AM
11            11/7/2007 8:28:11 AM
12            10/30/2007 8:14:46 AM
13            7/28/2003 2:56:47 PM
Randy Peterson
Software and Romaing Standards Architect

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros