You need to sign in to do that
Don't have an account?
Transforming a date input field into a date range input field
I've got some code that grabs a date and inputs it into a SOQL query. Looks like this:
Controller:
I'd like to mod this into two field inputs, one for a lower and one for a upper end date range. Does anyone have any tips in how I could do this? I know there are a lot of special tidbits in relation to dates to make coding simplier.
Controller:
if (ven_createdby != null && ven_createdby != ''){ string tempven_createdby = ven_createdby; tempven_createdby = String.escapeSingleQuotes(tempven_createdby); //To avoid SOQL injection tempven_createdby = tempven_createdby.startsWith('%') ? tempven_createdby : '%' + tempven_createdby; tempven_createdby = tempven_createdby.endsWith('%') ? tempven_createdby : tempven_createdby + '%'; queryString += whereOrAndClause() + ' CreatedBy.Lastname like \''+tempven_createdby+'\'';
I'd like to mod this into two field inputs, one for a lower and one for a upper end date range. Does anyone have any tips in how I could do this? I know there are a lot of special tidbits in relation to dates to make coding simplier.
WHERE Period_Ending_Date__c >= :fromDate.Date__c AND
Period_Ending_Date__c <= :toDate.Date__c