Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8829485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:50:36+00:00 2026-06-14T07:50:36+00:00

I want to compare dates in a TypoScript select. Here’s what I have (note

  • 0

I want to compare dates in a TypoScript select.
Here’s what I have (note that I commented the were clauses) :

lib.my_val = CONTENT
lib.my_val {
  select {
    pidInList = 100000
    max = 1
    #where = effective_date < CURDATE()
    #where = TIMESTAMP(effective_date) < NOW()
    orderBy = effective_date DESC
  }
  table = tx_my_table
  renderObj = COA
  renderObj {
    5 = TEXT
    5{
      field = my_field
      wrap = <span>|</span>
    }
    [...]
  }
}

Which returns lines.

I tried to add a where statement any way I could with static dates or variables… without success. My understanding of the where clause is that everything after the = is dumped as is in the SQL query. But it seems I missed something.

Basically I want the TypoScript to generate a SQL Query smilar to this :

SELECT * FROM tx_my_table WHERE effective_date < NOW() ORDER BY effective_date DESC LIMIT 1;

This should be simple. Has anyone done this in the past?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:50:37+00:00Added an answer on June 14, 2026 at 7:50 am

    Your TypoScript seems to be OK.

    • What happens if you enter the SQL Query directly into MySQL?
    • Note that with your code, only one record with pid=100000 is
      selected.
    • Have you tried this:

    —

    lib.my_val {  
           select {  
            pidInList = 100000  
            max = 1  
            where = UNIX_TIMESTAMP(effective_date) < UNIX_TIMESTAMP()  
            orderBy = UNIX_TIMESTAMP(effective_date) DESC  
          }  
          table = tx_my_table  
        }
    

    TYPO3 Wiki on select

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two lists with data that I want to compare dates for. I
I have a date field that submits the chosen dates and I want to
I want to compare 3 dates using jquery ui date picker. I have the
I want to compare two dates in C# i have tried Toshortdate() but its
A search API is returning date in String format,I want to compare that date
I want to compare them: both of gems have advantages and disadvantages. For example
I want to make a notification system. Shortly.. to compare two dates, the only
I want to compare between two dates. From both the dates, I am fetching
i have a range of weekly dates like example 1-5-2010 to 7-5-2010 i want
How do I compare two dates in Lingo? To be specific, I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.