I work on ServiceNow application, I have requirement that I don't want to run the scheduled job on last 2 days of every month so I'm looking for JavaScript query where i can get last 2 days of every month so that i will filter out those days in scheduled job.  Can anyone help me with this  Thanks, Chaitanya
45055
If you provide 0 as the dayValue in Date.setFullYear you get the last day of the previous month:  d = new Date(); d.setFullYear(2008, 11, 0); //  Sun Nov 30 2008   There is reference to this behaviour at . Is this a reliable cross-browser feature or should I look at alternative methods?
119807
I am trying to retrieve list items using date range based on date column. It implicit both 'Fromdate' and 'Todate'.My CAML query is also querying on two other conditions as well. I am using the below query but it is not retrieving the data.when I remove the date range from query data is retrieved fine. But i want date range as well in my query how would i do this. Little help would work for me.   camlQuery.set_viewXml('&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;And&gt;&lt;And&gt;&lt;Neq&gt;&lt;FieldRef Name="ID" /&gt;&lt;Value Type="Number"&gt;0&lt;/Value&gt;&lt;/Neq&gt;&lt;Eq&gt;&lt;FieldRef Name="_ModerationStatus" /&gt;&lt;Value Type="ModStat"&gt;0&lt;/Value&gt;&lt;/Eq&gt;&lt;Geq&gt;&lt;FieldRef Name="Created" /&gt;&lt;Value Type="DateTime"&gt;' + fromDate + '&lt;/Value&gt;&lt;/Geq&gt;&lt;Leq&gt;&lt;FieldRef Name="Created" /&gt;&lt;Value Type="DateTime"&gt;' + toDate + '&lt;/Value&gt;&lt;/Leq&gt;&lt;/And&gt;&lt;/And&gt;&lt;/Where&gt;&lt;OrderBy&gt;&lt;FieldRef Name="_ModerationStatus" Ascending="True" /&gt;&lt;/OrderBy&gt;&lt;/Query&gt;&lt;/View&gt;');
51409
How to access Submitted date of apex jobs because it is not a standard field of asyncapexjob ?
15108
We need to accomplish the following:  On the 1st day of each quarter, we would like to update all open opportunities that have "close date" in the past quarter and set the new "close date" to be the last day of this new quarter.  I'm new to SFDC, but from my research it seems triggers or Time-dependent workflow may not do this. Can we write and schedule a cron script to do this?  Any help will be greatly appreciated! Thanks!
14041
I want to use LookupOrderedRows and return rows between a start and end date (last month range). What is the best way to handle using Ampscript?   I can add one date to the where using   "DateField", @varStartDate,   But if I add the below to add additional where filters  "DateField", @varStartDate,"DateField", @varEndDate,   I get this error:     "Duplicate Key Field Name: DateField"   EDIT: Also I tried the range as the var for the LookupOrderedRows using   set @strRange = StringToDate(Format(DateDiff(@strStartDate, @strEndDate, "M"),"MM/dd/yyyy"))  and then in the LookupOrderedRows just using  "DateField", @strRange  But that got an error as well.
74515
I am using sql server 2005. I just want to know is there something we can get the week number for the particular month. Example Date = '2008-10-16' Is there something we can have SELECT WEEK(Date). Or any better suggestion.
60087
I'm attempting to set up an email template based on the time of day to begin an email with either a "Good Morning" or a "Good Afternoon" greeting based on the time of day that the email was sent.  I see that the {!Now()} function provides me with the current date and time. However, I'm rather new to Salesforce, and haven't been able to figure out how to capture just the time for a comparison in a conditional statement something like Good {!if {!Now()} &lt; "12:00 AM", "Morning", "Afternoon"}.   I've done quite a bit of searching, and haven't yet been able to find an answer to this question. Any help or reference material would be most appreciated. I've already scoured the Salesforce help pages (including the  page), and browsed the internet for a solution.
56250
I'm new to filtering dates with REST in SP but am trying to do something like below but am not sure how to get today's date in as a variable into the request. I don't think I'm too far off so any help is greatly appreciated.       var today = new Date();     $.ajax({         url: "/_api/web/lists/GetByTitle('DateItems')/items?$orderby=SortOrder asc&amp;$filter=StartDate le datetime'" + today + "' and EndDate ge datetime'" + today + "'",         ...     });
99276
How can i insert missing dates from a query i created.  The result below:  Date          Frequency 2014-05-18    5 2014-05-20    7 2014-05-25    7 2014-05-27    6   I want the result to have missing dates with 0 value as shown below:  Date          Frequency 2014-05-18    5 2014-05-19    0 2014-05-20    7 2014-05-21    0 2014-05-22    0 2014-05-23    0 2014-05-24    0 2014-05-25    7 2014-05-26    0 2014-05-27    6   Please note that I have read only access to the server.
33173
I would like to query an object that would return the "Created by" date from all custom apps in my org. Is there a way to do this through SOQL?
907
I am building a WP site with an events feature. The events page was made with custom post types.  I want to make it possible for people to search/ filter events by dates. For example, they can search for all events happening between 2nd December, 2011 and 1st March, 2012 and get results from events that have their dates between the months of December and March (ie. december, january, february and march).  I want to know the best way to go about this. Any ideas?  You can see an example of what I want to achieve by looking at the "Search events by date" feature on this page   If that won't be possible, is there any way I can get them to search for events happening between certain months, say December and February(excluding the days)?  Thanks in advance.
3014
I am using the below script to move two days back when script runs at starting two days of the year and also check first and second days of every month and move two days back. if [$month=&quot;01&quot;] &amp;&amp; [$day=&quot;01&quot;]; then         date=&quot;$last_month/$yes_day/$last_year&quot;         fulldate=&quot;$last_month/$yes_day/$last_year&quot; else         if [$month=&quot;01&quot;] &amp;&amp; [$day=&quot;02&quot;]; then                 date=&quot;$last_month/$yes_day/$last_year&quot;                 fulldate=&quot;$last_month/$yes_day/$last_year&quot;         else                 if [ $day = &quot;01&quot; ]; then                         date=&quot;$last_month/$yes_day/$year&quot;                         fulldate=&quot;$year$last_month$yes_day&quot;                 else                         if [ $day = &quot;02&quot; ]; then                                 date=&quot;$last_month/$yes_day/$year&quot;                                 fulldate=&quot;$year$last_month$yes_day&quot;                         else                                 date=&quot;$month/$yes_day/$year&quot;                                 fulldate=&quot;$year$month$yes_day&quot;                         fi                 fi         fi fi  But my bad am getting the below error message Etime_script.sh: line 19: [06=01]: command not found Etime_script.sh: line 24: [06=01]: command not found
526
I'm creating an application which lets you define events with a time frame.  I want to automatically fill in the end date when the user selects or changes the start date.  I can't quite figure out, however, how to get the difference between the two times, and then how to create a new end Date using that difference.
55117
I have a list, a list filter and two date filters(Start date and end date) in a page. First I have to filter list using this filters and then I have to approve whatever item are left in the list after filtering.  I am using the following JavaScript code.      &lt;script type="text/javascript"&gt;  //var siteUrl = '/projects/SharePoint2013-Demo/TimesheetManagementSystem/'; var oList = null; var web = null; var clientContext  = null;    function retrieveListItems() {  var filterValue =document.getElementById("ctl00_ctl41_g_1c91c2d4_fbbb_4792_8507_ba589e5be222_SpListPicker_SelectionBox"); var StartDate=document.getElementById("ctl00_ctl41_g_ed4beb82_8f7e_4389_bb35_a44188462aab_DateFilterPicker_DateFilterPickerDate");   var EndDate=document.getElementById("ctl00_ctl41_g_07c2185d_e903_4010_8a84_b2d9536a5549_DateFilterPicker_DateFilterPickerDate"); alert(filterValue.value ); alert(StartDate.value); alert(EndDate.value);       clientContext = new SP.ClientContext.get_current();     oList = clientContext.get_web().get_lists().getByTitle('TimeSheetList');     clientContext.load(oList);      clientContext.executeQueryAsync(LoadList, onQueryFailed);           }   function LoadWeb123(sender,args) {     //oList = web.get_lists().getByTitle('TimeSheetList');      //clientContext.load(this.oList);     //clientContext.executeQueryAsync(Function.createDelegate(this, this.LoadList), Function.createDelegate(this, this.onQueryFailed));     }    function LoadList() {            var  camlQuery= new SP.CamlQuery();                    camlQuery.set_viewXml("&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;And&gt;&lt;And&gt;&lt;Eq&gt;&lt;FieldRef Name='Author'/&gt;&lt;Value Type='User'&gt;vikash kumar&lt;/Value&gt;&lt;/Eq&gt;&lt;Geq&gt;&lt;FieldRef Name='Date' /&gt;&lt;Value Type='DateTime'&gt;2015-07-10T12:00:00Z&lt;/Value&gt;&lt;/Geq&gt;&lt;/And&gt;&lt;Leq&gt;&lt;FieldRef Name='Date' /&gt;&lt;Value Type='DateTime'&gt;2015-07-17T12:00:00Z&lt;/Value&gt;&lt;/Leq&gt;&lt;/And&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;/View&gt;");       camlQuery.set_viewXml(camlQuery);      this.collListItem = oList.getItems(camlQuery);       clientContext.load(collListItem);     clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));     }    function onQuerySucceeded(sender, args) {      var listItemInfo = '';       var listItemEnumerator = collListItem.getEnumerator();      while (listItemEnumerator.moveNext()) {                 var oListItem = listItemEnumerator.get_current();                 var ID= oListItem.get_id();                 alert(ID);                 } }   function onQueryFailed() { //    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());     alert('error'); }   &lt;/script&gt;  &lt;button type="button" onclick="retrieveListItems()"&gt;Approve!&lt;/button&gt;   But this is not working, it gives error alert.  What could be done? Is there anything wrong with the code?
27460
Given a date range, I need to know how many Mondays (or Tuesdays, Wednesdays, etc) are in that range.  I am currently working in C#.
51077
I run a job every minute to reindex my site's content.   Today, the search engine died, and when I logged in there were hundreds of orphan processes that had been started by cron.  Is there another way using some kind of existing software that will let me execute a job every minute, but that won't launch another instance if that job doesn't return (i.e. because the search engine process has failed)?
600
How do I get the number of days between two dates in JavaScript? For example, given two dates in input boxes:  &lt;input id="first" value="1/1/2000"/&gt; &lt;input id="second" value="1/1/2001"/&gt;  &lt;script&gt;   alert(datediff("day", first, second)); // what goes here? &lt;/script&gt;