select distinct date question

  • Thread starter Thread starter seegoon
  • Start date Start date
S

seegoon

Hi to all.
How can I structure a select distinct date command that EXcludes the
time part of the datestamp. If I run a "select distinct date from
dbase" command I get all the records with different times(100's of
records) , I only want the distinct DATES , without associated
times.I'm working in VB.net
Hope I'm making sence.
Thanks
Rob
 
I don't know against what kind of datasource you're running, but if
using MS-SQL take a look at the Substring method:

SELECT DISTINCT SUBSTRING(myDate,1,10) As ShortDate
FROM myTable

/Snedker
 
That would be

SELECT DISTINCT Left([myDate],10) AS ShortDate
FROM myTable

Though, you may have to select it into a temp table since Left is a
built-in Access function - not actual SQL-language.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top