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
0
votes
1answer
2k views

Comparing datetime variable to null always gives false

I am trying to compare a datetime field with value to null even if I compare both of them it always gives false The code I am running Datetime a; Datetime yesterday = Datetime.now().addDays(-1); ...
0
votes
1answer
117 views

SOQL Query to compare dates on child object records

I need to run a query to compare dates on child objects. We have a custom object Job Placements (child of Contacts) with Start Date and End Date fields. I need to find all Job Placements where the ...
2
votes
2answers
2k views

CloseDate Using Apex

How Do i need to Write APex Code for the CloseDate on Opportunity object? Opportunity Opp= new Opportunity(); Opp.Name='Beginner'; Opp.CloseDate= ?????; Opp.StageName='Proposal'; ...
0
votes
2answers
112 views

Type Exception : DateTime

We have a custom object Yodlee_Accounts__c (Yodlee_Accounts__c) with a DateTime field (Yodlee_Last_Updated__c). I am trying to create a new record with value set in the field as below without success....
0
votes
1answer
416 views

All Day Events in a lightning component

I'm building an events component that shows events based on a dropdown for Today, Tomorrow, This Week, and Next Week. But, I'm running into an issue with all day events. I'm basing a query off of ...
2
votes
1answer
1k views

JSON_PARSER_ERROR: Cannot deserialize instance of date from VALUE_STRING [duplicate]

I am trying to insert date from csv file into Salesforce (Sandbox for now). I have a csv file that has this format YYYY-MM-DD hh:mm:ss. Bottom is screenshot from a csv file. I tried inserting into ...
0
votes
1answer
20 views

Derive Month of a Date Field to group by in Standard Summary Report

I want to derive the month of a date field called MeetingDate__c. Purpose of this is to display all Meeting Records grouped by the derived month. I have created a formula field to derive the month ...
1
vote
1answer
4k views

How to pass Date as parameter?

I am trying to create new opportunity passing 3 arguments into a method. how do I pass date since it is one of three required fields? Below is what I have at the moment. public static void ...
1
vote
1answer
646 views

Change Date Format inside label

I want to edit the date format inside the label from YYYY-MM-DD to MM/DD/YYYY <ui:inputSelectOption text="{!event.Id}" label="{!event.Name + ' - ' + event.Event_Start_Date__c}" class="eventList" /&...
0
votes
1answer
158 views

Creating a query based on creation date

I am trying to figure out how to create a query based on creation date. I tried the following: select s.emailaddress , s.subscriberkey , s.status , s.datejoined from _subscribers s where s.dateJoined ...
0
votes
2answers
2k views

Convert String to Date in Apex and calculate the days difference

I have two String dates in apex and I want to calculate the difference in days in salesforce. I was trying with the below code, but it was giving me Line: 4, Column: 1 System.TypeException: Invalid ...
1
vote
2answers
2k views

To set a Blank date in a Apex formula

I have a simple formula date field which I want to return a BLANK DATE (not a NULL) if the criteria is false. I tried many syntax, but all failed
0
votes
1answer
19 views

Inconsistency of data when seen on VF Page and Sites in Date Format

The Date format when we are seeing the data in VF page is DD/MM/YYYY and when same is viewed from the sites the format is MM/DD/YYYY. Below is the code snip. <apex:repeat value="{!wrpPhaseList}" ...
0
votes
1answer
356 views

Subtracting months in Process Builder

I have a date field (datefield__c) that i want to subtract 11 months. How can I do this using formula in Process builder? I tried to use the below code: DATE(YEAR(datefield__c), MONTH(datefield__c) - ...
0
votes
1answer
526 views

Combining relative and static date filters in the dataflow Salesforce Wave/Einstein Analytics

I've created an opportunity, revenue, account, accountplan dataset. On the opportunity is a highly complex revenue logic so we decided to have a revenue field for each month. To get all those objects ...
0
votes
2answers
216 views

Exporting a data extension messes up the date format

I'm trying to export a Data Extension via a browser download. It is not a large data extension - around 2,000 records. When I open up the exported file (a csv file), I get a mixture of two date ...
0
votes
1answer
152 views

Creating unique records based on field values

There are 2 objects say, Object1 and Object2 both having 2 fields each, say City(Text) and BatchDate(Date). Object1 records get created through integration with external system and Object2 records get ...
-2
votes
3answers
513 views

Show records from tomorrow and within 30 days using ampscript

I have 2 DE, Meeting and subscriber. I want to show records dynamically in email I used LookupOrderedRows() to fetch records, now i want to show only 1st record (meeting), which starts from tomorrow ...
1
vote
1answer
291 views

Date Formula - Want a Start to End Date Formula Field

I want to have a formula field that displayes the Start Date of an event to the End Date of an event, i.e (01/01/2017 - 31/12/17) - Like this But when I try to make it like this I can't as the dash ...
0
votes
1answer
99 views

Retrieve date from from date-time datatype?

Hi I want to get only date value from CreatedDate Example: select id,name,createdDate from Account where DAY_IN_MONTH(createdDate) =: 12 Which retrieves account created on date 12. How to achieve ...
0
votes
1answer
35 views

Operation betwenn two date / datetime

In a condition, I had to make a substraction between two datetime and check how many days a separating the two datetime like that : if(datetime2 - datetime2 > 5){ //do something } Of course ...
1
vote
1answer
111 views

How do I localize a date field in an SOQL query?

Per the docs on the FORMAT() function, I can localize numeric, datetime, and currency fields in an SOQL query by wrapping the field name in FORMAT(). This does not work for date fields; I either get ...
0
votes
2answers
163 views

Workflow rule based on Account custom Date field not firing

I created my WFR on the Contact object. "Arrival__c" is an Account custom date field that should trigger an email alert to all Contacts of said account on the arrival date. There is also a picklist ...
1
vote
1answer
573 views

SAQL - When I dynamically create dates in SAQL and group them, I can't use the “Timeline” chart

I try to create a timeline chart for every year for products on the market that are started to sell before that year and ended to sell after that year. To get my filtered data I filter them like I ...
0
votes
1answer
65 views

How to make a date formula which calculates booking date + current month + 3 months(90 days) in salesforce

Example: If Booking date is -> 7 June 2017, I want the formula to calculate the current month (June) + 3 months(90 days), and the formula should return 29th September 2017 Calculating as ...
1
vote
2answers
852 views

Workflow field update on date field to add 10 years

I am not too good with formulas but i have a workflow and i need to create a formula on my field update that will update my custom field "End Date" 10 years ahead in the future.
1
vote
2answers
797 views

Why does it say “DateTime does not exist”?

Apex Code public class TaskTriggerHelper { public TaskTriggerHelper(){ } public static void createTask(list<Task> tskList){ list<task> listOfTask = new list<task>(); ...
-3
votes
1answer
760 views

Issue with date in Apex Maps [closed]

I am populating a map indexed by enddate. When I print the date property in apex before storing the map as key it prints yyyy:MM:DD 00:00:00. When I store it in the map it only print yyyy:MM:DD. ...
0
votes
1answer
71 views

Expiry date of source org?

I signed up for two developer editions about three months ago and today I received the notification that it is about to expire. Is there a process where I can see the actual date?
4
votes
1answer
102 views

Why does the value in my formula field value in the UI differ from value returned from SOQL on the same Opportunity Line Item?

I have two custom fields: IsCurrentFormula__c, a formula field that evaluates whether or not today's date falls between an Opportunity Line Item's effective and end date (eg. within a range of dates)....
2
votes
3answers
9k views

Relative Date Value (THIS WEEK,NEXT WEEK,LAST WEEK)

I have below filter in List view for my custom object and client's locale is US English. Scheduled Date equals THIS WEEK List view retrieves all records with scheduled date from Sunday to Saturday....
1
vote
1answer
1k views

How to change date format depends on user locale?

I want to change date format depends on logged in user locale. Date start_date = 2017-25-11; If user is from China, start_date should display as: 2017-25-11 If user from US, start_date should ...
1
vote
0answers
82 views

For date field type in salesforce wave analytics, internally many sub fields for date gets added. What can i do to get only the field that i provide?

For example i have a date type field as ClosedDate in the external CSV file that i need to upload to create a dataset, when i try to see the fields, internally many sub fields gets added as follows: ...
1
vote
0answers
464 views

How can I establish schedules on opportunity products (with daily installment period excluding weekends)?

Background: Under Opportunity tab, I will go and create a new Opportunity. In the Opportunity Detail, there should be a button to add Product When adding new Product, I click the 'Establish' button ...
-1
votes
1answer
75 views

Salesforce Date field (add a month/31 days but cannot end on weekend)

I have two fields in a particular opportunity. One is the "Proposal Sent Date" which is automatically entered when the user generates the proposal (via Conga Composer). I also have the "Proposal Valid ...
2
votes
1answer
995 views

invalid date - When changed date format from US to UK

I need some help with switching the format from DD-MM-YYYY or MM-DD-YYYY to ISO Standard (YYYY-MM-DD)in JavaScript. I'm using this on a custom URL Button. This is what i'm doing, and It is working ...
1
vote
2answers
106 views

Convert a number picklist to date field & send email on that date before

I have a picklist with values from 1 to 31.It corresponds to the date. My requirement is to convert this number selected to a date. Lets say the number selected is 20 then it has to correspond to 20th ...
9
votes
1answer
5k views

How to pass Date from Lightning to Apex

In Lightning component I have attribute and input for date: <aura:attribute name="myDate" type="Date"/> <!-- ... --> <ui:inputDate aura:id="my-date" labelClass="slds-form-...
0
votes
2answers
583 views

Problem with date when uploading a csv via DataLoader

I'm having an issue when uploading a date from a csv via DataLoader. The date on my csv is for example 2017-04-03, but when uploading it via DataLoader, it will be 2017-04-02 in SF (always one day ...
3
votes
1answer
836 views

Get Difference Between 2 Dates in Months Without Exceeding 5000 Characters

I am trying to determine the variance (in months) between an actual date and a planned date. The actual date can be either before or after the planned date, and this is what is making this difficult. ...
5
votes
1answer
2k views

Date.newInstance() bug?

I was having issues with a method that was repeatedly printing out wrong dates, when I executed this in anonymous apex Date foo = date.newinstance(2016, 27, 7);//year, month, day system.debug(foo); ...
3
votes
1answer
2k views

How to prevent manual entry in ui:inputDate

I have used <ui:inputDate> for entering date as follows: <ui:inputDate aura:id="ValidFrom" label="Valid From" class="slds-input" labelClass="slds-form-element__label" value="{!v.ValidFrom}" ...
0
votes
0answers
6k views

Check if Date field is empty

How can I check if a Date field is empty or blank? I tried this statement: if(project.Current_Launch_Date__c==null) But I don't get the desired result, even if I delete the date value, it still does ...
0
votes
2answers
307 views

Trigger workflow n hours before a date field

I am trying to schedule a workflow to send an email alert 52 hours before a class starts. Class is held at the same time every day (2pm) it's offered and therefore class_date was set up as a Date ...
0
votes
2answers
72 views

Help with formula field

I have a custom object called Project. Within this object I have two important date fields – Finance Expiry date (Finance_Expiry_Date__c) and Contract Expiry date (Contract_Expiry_Date__c). These two ...
0
votes
3answers
701 views

Show dynamic content block based on date and last update

I have created a dynamic content block, which is meant to be added to our email template. It is a top banner, which should only be shown if a customer have made updates to their basket within the last ...
7
votes
1answer
15k views

How To Format Datetime like 2017-01-10T14:53:55.000+0000?

Using Apex, how can I format a Datetime variable the same way it is displayed in SOQL result? It seems that SOQL uses the UTC format. When I run the following query SELECT CreatedDate FROM Account ...
3
votes
1answer
80 views

Custom Case Change Due Date button

I'm trying to create a button that would change the Due Date field of a selected case in a List View. I'm stuck on the URL, since this is a mass change type would there be a custom URL that would be ...
0
votes
4answers
891 views

Apex: How to generate List of all Friday Dates for given month

I am trying to create a List of date type which contains every Friday of the month in it. So for example, for the month of March, the list would contain the dates of March 3rd, 10th, 17th, 24th and ...
1
vote
3answers
1k views

dataloader csv file date format

I am using data loader to export salesforce data to csv format. In the csv file all the date and time fields are coming as like '2017-03-08T06:18:46.000Z'. Is there any way to change the format like '...

1 2 3 4 5 11