Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, February 22, 2025 
 
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 - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Accounting for 'time' differences when comparing dates
Dan Delisle
Posts: 38
 
Accounting for 'time' differences when comparing datesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Sep 13 4:23 PM

Hello all,


I have been struggling for awhile now on getting the logic correct for a simple checkbox to get checked. The goal is that if a Ticket gets closed within 24 hours of the date/time it is received then the checkbox should be checked. The part that I am struggling with is how to account for the different ways that times are being displayed and stored in SalesLogix as well as trying to account for weekends. We are using SalesLogix version 7.5.0.1 (LAN) with SQL. For us, Saleslogix is published through Citrix, and the Citrix servers are set to Arizona time. Below is my code so far. Am I completely out in left field?


I think my biggest struggle (other than being barely proficient at VBscript) is that I cannot work the logic in my head, so I'll try to write it in plainly here.


If a Ticket is closed within 24 hours of it's received date then checked= T. However, Saturday and Sunday should not be counted in the calculation. I hope this makes sense. Any help provided would be most appreciated!


 


<pre><p>If pklStatus.Text = Application.Translator.Localize("Closed") Then

 


Dim strSQL
Dim objrs
Dim TNUM


   TNUM = edTicketID.Text


   Set objRS = objSLXDB.GetNewRecordSet
       strSQL = "Select ReceivedDate From Ticket Where Ticketid = '" & TNUM & "'"    
       'msgbox(DateAdd("h",24,(txtReceivedDate.Text)))
      objRS.Open strSQL, objSLXDB.Connection
       If Not objRS.EOF Then
         txtReceivedDate.Text = objRS.Fields("RECEIVEDDATE").Value & ""  'DNL
       Else
         objRS.Close
      End If
''ReceivedDate is stored as UTC +7

 

 


     If DateAdd("h",24,(txtReceivedDate.Text))> NOW  Then
        'msgbox("16" & DateAdd("h",16,(txtReceivedDate.text)))
        msgbox (NOW)
            chkResolved.Checked = True
     End If


 


     If Weekday (txtReceivedDate.Text) = vbFriday Then
     If DateAdd("h",65,(txtReceivedDate.Text))< NOW  Then
        msgbox("Fri" & DateAdd("h",72,(txtReceivedDate.text)))
            chkResolved.Checked = True
     End If


     End IF



    If Weekday (txtReceivedDate.Text) = vbSaturday Then
     If DateAdd("h",65,(txtReceivedDate.Text))< NOW  Then
        'msgbox("Sat" & DateAdd("h",72,(txtReceivedDate.DateTime)))
            chkResolved.Checked = True
     End If


     End IF



  If Weekday (txtReceivedDate.Text) = vbSunday Then
     If DateAdd("h",41,(txtReceivedDate.Text))< NOW  Then
        'msgbox("Sun" & DateAdd("h",48,(txtReceivedDate.DateTime)))
            chkResolved.Checked = True
     End If


     End IF



End If


[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 © 2025 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): 2/22/2025 9:36:44 AM