In my data extension dynamically records will created every day. Here i want know how many records will created every day. I am unable to fetch the today date values in lookuprows for equal to Createddate field.

In my DE Createddate field value is Monday, "January 04, 2021 11:16 AM" when i am print the Createddate field value will be like this "1/4/2021 11:16:47 AM"

I also tried Createddate field static value, did not work on lookuprows. I have tried multiple ways like below. How can i achieve my requirement.

VAR @Today, @rows
Set @test= "January 04, 2021 11:16 AM"
Set @test1="1/4/2021 11:16:47 AM"

SET @Today= Now()
SET @SDL = SystemDateToLocalDate(@Today)
Set @Formatdate=Format(@Today, "d", "Date")

set @rows = LookupRows("TestDE","Createddate",@Today)
set @rowCount = rowcount(@rows)
CourseCount: %%=v(@rowCount)=%%
  • do the records in the DE have a time stamp?
    – EazyE
    Jan 20, 2021 at 15:03
  • @EazyE yes DE records have a time stamp
    – Sfdcprgmr
    Jan 20, 2021 at 15:23
  • are you able to normalizae the time stamp to 00:00:000
    – EazyE
    Jan 20, 2021 at 16:07
  • Sorry@EazyE, this format is customer request
    – Sfdcprgmr
    Jan 21, 2021 at 4:47

2 Answers 2


AMPscript will only do an exact comparison. We can't retrieve today records count from DE. We need set up a SQL Query to put this into a separate DE. we can do something like just createdadate equal to today , or between two specific times (e.g. 12:00AM and 11:59PM) in query.


I ran a quick test in my environment and by switching this line:

set @rows = LookupRows("TestDE","Createddate",@Today)


set @rows = LookupRows("TestDE","Createddate",@Formatdate)

it returned a course count.

  • Here Createdate field datatype is date, value is (3/4/2019 10:26:47 AM) dynamically loading. I tried @Formatdate also its not working
    – Sfdcprgmr
    Jan 21, 2021 at 4:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .