Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Select a month in SQL
Select a month in SQL [message #29311] Fri, 15 October 2010 10:01 Go to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello all

A very simple question. How do you do to select all the registers of a month?

For example, this expression to select all people born in November, is not permitted:

SQL & ::Select(SqlAll()).From(TABLE)
			.Where(Month(BIRTHDATE) == 11);


Best regards
Iñaki
Re: Select a month in SQL [message #29321 is a reply to message #29311] Fri, 15 October 2010 13:34 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

What type of SQL server?

SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Select a month in SQL [message #29330 is a reply to message #29311] Fri, 15 October 2010 14:37 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Fri, 15 October 2010 04:01

Hello all

A very simple question. How do you do to select all the registers of a month?

For example, this expression to select all people born in November, is not permitted:

SQL & ::Select(SqlAll()).From(TABLE)
			.Where(Month(BIRTHDATE) == 11);



Well, maybe it should have been permitted. But as this is rarely needed, nobody contributed the Month function yet.

Implementation will wildly vary based on database used, I am afraid.

Anyway, since then, you will have to look it up in your SQL reference and put into your U++ sql expression using generic SqlFunc. Then post it here so that we can start adding it to sqlexp (we in fact do NOT need all variants immediately).


Re: Select a month in SQL [message #29356 is a reply to message #29330] Fri, 15 October 2010 23:07 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello

I understand. I thought it was more standardized... I am not a SQL expert.


Best regards
Iñaki
Re: Select a month in SQL [message #29358 is a reply to message #29356] Sat, 16 October 2010 00:03 Go to previous message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

In MySQL - function MONTH(BIRTHDATE)

SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Previous Topic: Sqlite: Missing GetTransactionLevel() Method - Implemented
Next Topic: Missing ASSERT?
Goto Forum:
  


Current Time: Sat Apr 20 01:36:44 CEST 2024

Total time taken to generate the page: 0.03790 seconds