Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Copper Elite Contributor
Posts: 41
Registered: ‎03-09-2009
Accepted Solution

SQL "Date" Code - What am I Missing??

Hi Everyone,

 

I know this shouldn't be difficult, but none the less am stumped by this little item...

 

From ADMIN app I go and run a 2 line SQL code

 

Line 1: Select * from Activity

Line 2: Where Startdate < '12/31/2010'

 

Seems simple and easy enough!!

 

But then I get records with a Startdate after 1/1/2011 (Please see attached JPG).

 

So what am I missing??

 

As always, thanks in advance!!

 

Joe

Employee
Posts: 314
Registered: ‎05-19-2009

Re: SQL "Date" Code - What am I Missing??

This works fine for me. 

 

Try using the Build Query button and see if that works.

Copper Elite Contributor
Posts: 41
Registered: ‎03-09-2009

Re: SQL "Date" Code - What am I Missing??

Hi Emma,

 

Actually you gave me an idea with the Build Query tool!!  I slapped together a one line code snippet and I noticed the difference in how the STARTDATE field was selected/formatted -

 

where startdate < '20101231 00:00:00'

 

versus

 

where startdate < '12/31/2010'

 

and the "new" code presented the correct values!!

 

No, I don't know why, but hey, I'm not complaining so thanks a bazillion for the assist and have a good day!!

 

Smiley Happy