Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, May 7, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - ADO General
Forum to discuss ADO specific questions for use with SalesLogix. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to ADO General | New ThreadView:  Search:  
 Author  Thread: Comparing slx datetime fields in Query Analyzer
Jonathan Webb
Posts: 2
 
Comparing slx datetime fields in Query AnalyzerYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Mar 06 6:23 AM

sertraline and alcohol side effects

sertraline and alcohol use
Hi All,

I'm a newbie to this, so please excuse if I have missed the obvious, but I want to do something like

WHERE modifydate >= '2005-12-31'

I have tried various conversion functions, but the only thing I can get to work is

WHERE datepart("yyyy", modifydate) >= 2005

which is not very satisfactory.

Any help would be appreciated.

[Reply][Quote]
Ted Sturr
Posts: 78
 
Re: Comparing slx datetime fields in Query AnalyzerYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Mar 06 12:26 PM

lasix

lasix click
fiogf49gjkf0d
I made some assumptions. I assume this database is a 6.x or higher database (the need for the GMT conversion) and that you are using an external tool like Query Analyzer (you mentioned this in your post). This statement will give you the results you want, but you should know there is still the potential for an hour descrepency due to daylight savings time, but that does not appear to be a concern for this broad of a query.

Your where clause should look like this:

WHERE CONVERT(VARCHAR(8), MODIFYDATE - (GETUTCDATE() - GETDATE()), 112) >= '20051231'

Ted
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Comparing slx datetime fields in Query AnalyzerYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Mar 06 12:26 PM

dulcolax

dulcolax online
fiogf49gjkf0d
where modifydate >= cast('2005-12-31' as datetime)

However, keep in mind that if you're on 6.2 or higher that comparing dates in QA might not give you the results you expect since all dates are stored as UTC dates. The SLX provider does translate those to local dates but through QA all you'll see is the UTC date value and you'd have to calcuate the offset yourself. Doing the query via the SLX provider however will give you all dates as you'd expect to see them.
[Reply][Quote]
Karl Ku
Posts: 3
 
Re: Comparing slx datetime fields in Query AnalyzerYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Mar 06 12:28 PM
Try casting it as a datetime datatype

WHERE modifydate >= cast('2005-12-31' as datetime)

WHERE modifydate >= cast([column] as datetime)


[Reply][Quote]
Jonathan Webb
Posts: 2
 
Re: Comparing slx datetime fields in Query AnalyzerYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Mar 06 1:40 AM

benadryl pregnancy nausea

benadryl and pregnancy
fiogf49gjkf0d
Thanks Ted, Ryan, Karl,

Much appreciated,

Jon.
[Reply][Quote]
Ron Buchanan
Posts: 72
 
Re: Comparing slx datetime fields in Query AnalyzerYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Apr 06 8:30 AM

buy venlafaxine xr

buy generic venlafaxine
fiogf49gjkf0d
I used to get stumped by this quite often... it's pretty simple if you put the date format in with the "/":

select * from account
where modifydate > '4/1/2006'

basically SQL converts this datetime to 2006-04-01 00:00:00.
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 5/7/2024 3:44:27 AM