Quantcast
Channel: Active questions tagged ampscript - Salesforce Stack Exchange
Viewing all articles
Browse latest Browse all 359

Using date time of today in look up ordered rows -Ampscript

$
0
0

Im trying to use a lookupordered row expression to find rows that have a submission date of today and display them, unfortunately I am not finding any matches. I am unsure if my syntax is incorrect or my understanding of date time is incorrect.

%%[VAR @currentSystemTime, @Today SET @currentSystemTime = NOW()SET @Today= FormatDate(SystemDateToLocalDate(@currentSystemTime), "YYYY-MM-DD")]%%%%[var @rows, @row, @rowCount, @numRowsToReturn, @lookupValue, @iset @numRowsToReturn = 20 /* 0 means all, max 2000 */set @rows = LookupOrderedRows("New-OPT_in_response-TODAY",@numRowsToReturn,"Clinician_Email desc, SubmissionDate asc","SubmissionDate", @today)set @rowCount = rowcount(@rows)if @rowCount > 0 then  for @i = 1 to @rowCount do    var @Clinemail, @date    set @row = row(@rows,@i) /* get row based on counter */    set @clinemail = field(@row,"Clinician_Email")    set @subdate = field(@row,"SubmissionDate")    ]%%    Row %%=v(@i)=%%, Clinician Email is %%=v(@clinemail)=%%, the time was %%=v(@subdate)=%%    %%[   next @i ]%%%%[ else ]%%No rows found%%[ endif ]%%

Viewing all articles
Browse latest Browse all 359

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>