Questions tagged [date]

A value that indicates a particular day. Unlike Datetime values, Date values contain no information about time

Filter by
Sorted by
Tagged with
1
vote
1answer
35 views

Report Grouping by Date

I'm relatively new to SF but gaining steam quickly. I've got Opportunities that include a contract start date and contact end date and I am trying to create a report that summarizes who we have ...
0
votes
1answer
40 views

Formula for assigning a value to all working days between 2 dates

I am logging Sickness in salesforce and have a start and end date. For reporting purposes i need to be able to assign a 1 to each of the working days between these 2 dates. Then when i report i can ...
1
vote
1answer
27 views

What other parameters does Date.parse(str) accepts other than str = 09/09/2018?

I was testing Date.parse(str) method with following types of inputs: String str1 = '06/06/2016' String str2 = '06-06-2016' String str3 = '2016-06-06' String str4 = 'July 6th, 2016' String str5 = '06, ...
-1
votes
1answer
70 views

Apex Trigger is not working appropriately on mass updating records

Hi friends i got a requirement to revenue loss field in case wth specific record type and condition and i need to update based on account and other object with lookup to account based on criteria. ...
2
votes
4answers
1k views

SOQL Error in Compare Date

Could you please help me for fix my SOQL Query? I have SOQL Scrip like : SELECT Employee_No__c FROM HREMPASSIGNMENT__c WHERE Payroll_Name__c=:selectedPayrollName AND Payroll_Name__c != null ...
0
votes
1answer
29 views

Process will not trigger on second date

I have set up a process on builder that should trigger when "a record is created or edited" and given the following criteria : (OR(TODAY() = DATEVALUE('2016-12-8'), TODAY() = DATEVALUE('2016-12-7')))...
4
votes
2answers
2k views

Passing Date field from Lightning component to Apex controller shows null

I have a custom salesforce object with a Date field. I am creating a new object of this type in a Lightning component, and trying to push this to the server. The objects are stored in a component ...
1
vote
1answer
97 views

Parse error from CSV static resource

I'm getting 'CSV Parse error 2016-12-02 13:45:21 is not a valid value for the type xds:dateTime' from compiler. I've done sample test data in CSV file according to: https://developer.salesforce.com/...
2
votes
1answer
559 views

Formula for writing a specific Day of Week date value?

Objective: create a List-View Button that writes the date value of the immediately upcoming Monday to a field in the selected record(s) E.g. if Monday is Dec 5, the expected output for writing a ...
1
vote
1answer
783 views

Trigger formula on specific date

I am trying to set a formula based criteria on process builder: (TODAY() = DATEVALUE(2016,11,29)) Trying to say that on a specific date, it should fire the subsequent actions. Am I entering the ...
1
vote
3answers
2k views

How to convert string into Date format?

I have 3strings. I want to convert it into date How to achieve this ? string a='20'; string b='4'; string c='1993'; String dt = DateTime.newInstance(a,b,c).format('d-MM-YYYY');
1
vote
1answer
190 views

Difficult SOQL query for Id between dates

Can anyone help me? Can I realize in soql query next fetch: I have a map Map< Id, List< List< Date >> (List< Date > consist of two values: StarDate and EndDate). For example I ...
1
vote
2answers
85 views

Task ActivityDate - Behaviour in Visualforce

For a number of apex:inputfields in Visualforce, I'm suppressing the Salesforce date picker and using the browser based one. I'm experiencing odd behaviour when attempting to do so on the Task ...
0
votes
2answers
789 views

Date format from Apex variable in VF

apex:variable var="Expiry" value="{!if((TEXT(object.Executed_Expiry_Date__c)!=null && TEXT(object.Executed_Expiry_Date__c)!=''),object.Executed_Expiry_Date__c, object.Expiry__c)}" ...
0
votes
2answers
570 views

How to retrieve start date and end date for fiscal month?

I want to compare today date and check is it fall into which fiscal month?How to retrieve what is start date and end date of the fiscal month? When I am google I only found fiscal year and fiscal ...
0
votes
1answer
47 views

how to find the period between two periods date?

I have one date "TRIG_DATE" date variable. I want to check where it falls under period1 or period2 In period 1 i have two fields "UperDate1__c" and "LowerDate1__c" In period 2 i have two ...
1
vote
2answers
7k views

How to add days with Date field?

I have one date field called "Billing date" and one Number Field called "Billing Delay". I want to update one Date field "DueDate" which computes "Billing date"+"Billing Delay" for Eg: "Billing ...
0
votes
1answer
733 views

How to check format of date in If condition & Convert that format to sfdc system format?

I am importing records from Data loader and there is date format in csv is : 27.08.2016 04:40:19 & Salesforce Does not support this format as it has English(United State) locale.. so, i am ...
0
votes
1answer
966 views

DateTime formula field to compare to a specific time

I am creating an entry criteria for a milestone to kickoff. A separate workflow rule populates a DateTime field (RMA_Time__c) with NOW(). When RMA_Time__c is populated and the populated time is before ...
1
vote
3answers
944 views

Default value for date field

I have created a new date field and set the default value to 'today()'. The date value is being shown for all the new records that are created after the creation of this date field. But the old ...
0
votes
1answer
1k views

how to remove the time stamp in a date field in an email template

When trying to use date field in template. Date is displayed as 'Wed Nov 09 00:00:00 GMT 2016' but I want the output as 'Nov 09 '. Please help me out.
14
votes
2answers
7k views

System vs Date/DateTime class

Is there any difference between System.today() and Date.today()? Similarly, is there any difference between System.now() and DateTime.now()?
1
vote
2answers
503 views

Web to Lead, Date showing in Debug page, but not in the Lead

My contact for is using 2 date pickets, Check-in/Check-out dates. When I fill out the form the dates show fine in the debug page. I receive and email with a link to view the lead and the dates are ...
0
votes
1answer
59 views

I am getting the following error message - Error: Unknown property 'OpportunityStandardController.line2

Error: Unknown property 'OpportunityStandardController.line2 here is my code up to where I get stuck: <apex:page standardController="Opportunity" showHeader="false" renderas="pdf"> <table ...
1
vote
1answer
1k views

How to get the last monday of every month [closed]

i need to get the list of last monday of every month between two dates. i have startdate and enddate. List<Date> dates= new List<Date>; while(enddate >= startdate) { //logic } i ...
1
vote
1answer
140 views

Why Custom Date field displays Year value till 2021?

I have created a field "Test Date" of type date on opportunity object. On Opportunity Record when I want to provide date value(year) as 2022 or 2023,it displays list of years till 2021. Scenario:when ...
1
vote
1answer
296 views

How to get last tuesday of particular month [closed]

I am having issue in finding the last Tuesday of particular month. i just have a date being passed to the method i want to get last Tuesday of month of that date.
2
votes
3answers
1k views

getting dates between two particular dates based on number of days

I have three things getting passed to a method that return List 1.Start date eg 1/1/2018 2.End date eg 1/8/2018 3.Days interval eg 7 days i want to get all the dates from start date to end date ...
0
votes
1answer
2k views

How to change input date format to mm/dd/yyyy?

Currently I am using the following tag in vf page to choose date.But it displays in dd/mm/yyyy format.How to convert it to mm/dd/yyyy format <apex:inputText value="{!datevalue}" size="10" id="...
1
vote
3answers
457 views

Formula field shows different values in list view and detail page

I have a formula field that is showing inconsistent behaviour between detail page layout and list view, report This is the formula field of datatype DATE DATEVALUE( DateTime_Field__c ) If ...
1
vote
2answers
3k views

Convert date in JSON to Date from String

While parsing JSON response from webservices, I'm getting date field as '03/21/2012' in a string format. My JSON2Apex parser class is converting this value in String and I'm facing hard time ...
1
vote
1answer
13k views

Date formatting to dd/mm/yyyy

My salesforce environment is on right Local setting all data on Salesforce Org is display as 'dd/mm/yyyy'. Recently I build a Lightning page which display some dates.but they display as 'yyyy-mm-dd' ...
1
vote
1answer
261 views

Apex: change datetime field to 8am the next day

I'm trying to change the value of a Datetime instance to 8am the next day. Going to the next day is fine: Datetime.valueOf(lead.Follow_Up_Date_Time__c).addDays(1); But how can I change the time to ...
1
vote
1answer
484 views

validation rule date field

I am doing first time in validation rule. I need this scenario Date field must be today or up to 367 days in the future. Could you please suggest the formula for the same. I did this way but it is ...
2
votes
1answer
1k views

Get the days and hours between two datetimes in decimal format

I have two dateTime fields, I need to get the amount of days and hours that have elapsed. This is the best i Can do but now im getting some errors. Heres the error System.TypeException: Invalid ...
2
votes
1answer
934 views

Converting a text field to date or datetime

I am trying to convert a text field that stores a value in datetime value into a formula field of date or datetime so that I can run reports off the formula field. Text Field: Last Login: 12/30/...
0
votes
0answers
2k views

Calculation of Days between two dates Salesforce Giving diffrent result in Dev Console and diffrent in Trigger

I am using simple formula to calculate days between two dates.How while running in Trigger it is giving me different numbers. Devconsole: Date Account_Opened_Date = Date.valueOf('2016-09-27'); Date ...
0
votes
1answer
1k views

Comparison of two dates in if statement

In my controller i try to compare two dates and if it tru return the error message. Date Today = system.Today(); Date StartDateParsed = Date.parse(startdate); if(StartDateParsed <= Today){bring ...
8
votes
1answer
7k views

SOQL How to select WHERE = 2 months ago

I'm tying to retrieve data from the 2 months ago. I tried WHERE = LAST_N_MONTHS:2 but this returns data from last month too. So for now I want everything from 1st July - 31st July. This needs to ...
0
votes
1answer
26 views

Show created and last edited date in custom date field automatically

I have followed instructions from this other stack exchange question to set/ show note modified date to the day it was changed or new. It does work fine but as you can see from the print screen it is ...
6
votes
1answer
1k views

Cleaner way to get last day of previous month? [duplicate]

Is there a cleaner way of getting the last day of the previous month? Also, is the Date.addMonth() function smart enough to deal with months having different numbers of days? As in, if I subtract 1 ...
1
vote
1answer
126 views

How to get date and time from Date object returned from GetUpdatedResult.getLatestDateCovered()

Database.getUpdated() returns a GetUpdatedResult object, which has a getLatestDateCovered() method. This method returns a Date object. When I do a System.debug to view the returned Date, I see a ...
0
votes
1answer
2k views

Fields of Attributes with Data Type Date are not in accordance with the Date format

I am learning to use Marketing Cloud and something is not working the way I want it to be. When I make a Records in a Data Extension where one of the attribute Data Types is Date, the field shows the ...
0
votes
1answer
197 views

Issue in Creating a process builder as per a Task Due Date

Need your help urgently. I tried several methods but failed. I have to create two fields under the object " Lead". ( for insurance industry) 1.Renewal month (January, February… December etc) 2. To ...
3
votes
2answers
1k views

Formula for exact years (including decimal places) between two dates

I'm using this formula to calculate a person's age: IF ( MONTH(TODAY()) > MONTH(Birthdate), YEAR(TODAY()) - YEAR(Birthdate), IF (AND(MONTH(TODAY()) = MONTH(Birthdate), DAY(TODAY()) &...
0
votes
3answers
243 views

How to set dateToday time in a test class?

I have a below code in my controller class. String sMonth = String.valueof(dateToday.month()); String sDay = String.valueof(dateToday.day()); if(sMonth.length()==1){ sMonth = '0' + sMonth; } if(...
1
vote
2answers
74 views

Constructing system date

I have to pass year (in string) from VF into backend (apex) and make a query on objX with the condition that the year value should lie between start date and end date values on objX. String ...
2
votes
3answers
476 views

How to do a query with one specific date

I want to do a query that excludes today and yesterday. I tried to do it in this way: CreatedDate != today AND CreatedDate != yesterday Is there any other way to do it?
0
votes
1answer
4k views

Visualforce input type date picker field

I am using date type field as Input type where serviceAssetItem is an instance of a wrapper class as follows: <apex:pageBlockTable value="{!ServiceAsset}" var="serviceAssetItem" id="assetListTable"...
5
votes
1answer
4k views

Using a specific dynamic date in a SOQL query where clause

I am trying to select a set of records in a batchable class that have expiration dates that are 7 or 30 days out. For the rest of the post I will only show 30 for brevity. I tried setting my query ...