SQL - take out the day+month

I have a field called daReportCreated which holds
the date where the record is created. The date
format is in dansih like this -

31-12-2007 15:08:00

I would like to take out the day+month and then count
which day each year that have the most records.

I found this help -

SELECT DATE(CURRENT_TIMESTAMP); - returns a date (2004-06-22)

But i don't know how to use it.
0
SpookiePower
12/14/2007 11:13:55 AM
access.queries 6343 articles. 1 followers. Follow

2 Replies
838 Views

Similar Articles

[PageSpeed] 12

Get the count of records for each day

SELECT DateValue(daReportCreated) as TheDate
, Count(daReportCreated) as TheCount
FROM YourTable
GROUP BY  DateValue(daReportCreated)

Get the maximum Count per year
SELECT Year(TheDate) as theYear , Max(TheCount) as BigCount
FROM qOne
GROUP BY Year(TheDate)

Combine
SELECT TheDate, theCount
FROM qTwo INNER JOIN qOne
ON qTwo.BigCount = qOne.TheCount
and q.TwoTheYear = Year(qOne.TheDate)

-- 
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"SpookiePower" <boxjunk2600@gmail.com> wrote in message 
news:eSvurJkPIHA.3532@TK2MSFTNGP04.phx.gbl...
>I have a field called daReportCreated which holds
> the date where the record is created. The date
> format is in dansih like this -
>
> 31-12-2007 15:08:00
>
> I would like to take out the day+month and then count
> which day each year that have the most records.
>
> I found this help -
>
> SELECT DATE(CURRENT_TIMESTAMP); - returns a date (2004-06-22)
>
> But i don't know how to use it. 


0
John
12/14/2007 1:25:26 PM
Thanks. It works :)

0
SpookiePower
12/14/2007 7:12:13 PM
Reply:

Similar Artilces:

Calling Dex Procedures from SQL
Is there any way to call dex procs from SQL or VB code? Jed There is an undocumented and unsupported method of calling Dex code from VBA. However, I know of no method of calling Dexterity from SQL. Please email me if you want an example, just remove the online. from the address below. David Musgrave [MSFT] Senior Development Consultant MBS Services - Asia Pacific Microsoft Business Solutions http://www.microsoft.com/BusinessSolutions mailto:dmusgrav@online.microsoft.com Any views contained within are my personal views and not necessarily Microsoft Business Solutions policy. This p...

How do you sort the data by the month of the data?
Hi, The file has date formate as MM/DD/YYYY and I want to keep it that way. Is there anyway the file can be sorted by only MM? I am trying to sort by Jan, Feb, March...... November, December together. Thanks, Saz You should create a new column, let's say G, with the formula G2: =MONTH(A2), where A is the column containing the date. Then you can sort according to this column. But if you have dates for more than one year, all the entries for January 2006 and January 2007 will be sorted together. Use instead G2=YEAR(A2)*100+MONTH(A2) to avoid this situation. Stephane. -- Message posted ...

is SQL 2000 architecture different SQL Server 2005 / 2008 architecture?
Hi I have a book "inside SQL Server 2000" by Kalen Delaney, which I have been told is a good book. I am going backwards... reading about the sql server architecture in chapter 3 of the book. As I'm reading... I was wondering is it different SQL Server 2000 vs SQL Server 2005/2008? Also where can I find a book/or link that can give me more details about the internals on architecture? Thank you norm (normanchan@gmail.com) writes: > Hi I have a book "inside SQL Server 2000" by Kalen Delaney, which I > have been told is a good book. I am g...

Moving customizations from SQL 2k to SQL 2k5 CRM
This may be a non-issue but I wanted to check to see if anyone has done this and ran into issues. I have the XML customization files from our previous install of CRM 3.0 with SQL 2k database. I now want to import and publish these same customizations to CRM 3.0 on SQL 2k5. Has anyone done this or can point me to documentation that tells about the success or issues for doing this? Thanks. On 7 Feb., 06:35, Chris Treanor <ChrisTrea...@discussions.microsoft.com> wrote: > This may be a non-issue but I wanted to check to see if anyone has done this > and ran into issues. > &...

Finding the difference in days between two dates?
Hi, I was wondering if anyone could let me know how I can find the difference in days between two date fields, would appreciate the help. Thanks Damon Damon; Just try this. Enter two dates ( 01/08/2003 and 21/08/2003 ) In another cell subtract the two dates, but format that cell as "General". If all is well, just must find a 20 in that cell. Or is it too simple and not what you want ? Mark Rosenkrantz. More Excel ? www.rosenkrantz.nl or info@rosenkrantz.nl ----------------------------------------------------------------- "Damon" <damon@nospam.co.uk...

CRM 3.0 Install Error with SQL Reporting Services and SQL 2005
Hi, Doing a CRM 3.0 Server installation. During the last page of the install wizard (or what I assume is the last page) when I goes through and does verification I get a red X next to SQL Reporting Services. The message I receive when I look at the details is: ***** The specified path is not a metabase path. Parameter name: path ***** Now SRS is installed and working. I put in the URL: http://<servername>/reportserver and every other variation on that I can find. Thoughts? Alan try http://servername/reports also assuming you did not use ssl... =======================...

count wednesdays within a month
I want to count how many let's say wednesdays are within a calendar month and for each month of the year -- sato panago Look here: http://www.cpearson.com/excel/DateTimeWS.htm#LastWeekday -- Kind regards, Niek Otten Microsoft MVP - Excel "sato" <maddoctor@metro.gr> wrote in message news:2F525B96-7111-416D-9903-D02A5ECF1C18@microsoft.com... >I want to count how many let's say wednesdays are within a calendar month >and > for each month of the year > -- > sato panago The general formula is: =4+(DAY(A1-DAY(A1)+35)<WE...

sql summarizing help
Hi All, Given: table1 --------- id, cdate, weeksago, amount, typeid, timeclose 496, 2010-02-11, 0, 450, 3, 1 490, 2010-02-01, 1, 200, 4, 1 491, 2010-02-01, 1, 350, 2, 2 493, 2010-02-01, 1, 500, 5, 1 489, 2010-01-21, 3, 150, 2, 1 136, 2010-01-12, 4, 500, 3, 2 137, 2010-01-12, 4, 100, 3, 1 138, 2010-01-12, 4, 500, 2, 1 1. i'm trying to create a sql that will give me a summary resultset grouped by weeksago. 2. i want to sum the columns and get counts based on typeid. 3. avg of timeclose here's the sql i have: select weeksago, , (sum(timeClose)/(count(timeclo...

SQL 'for xml' and C# example??
I'm missing some piece of the puzzle. I'm using 'for xml' type queries from SQL2K - and now trying to change the front-end from ADO to C#, I can't quite figure it out.. It seems that I could use an XmlReader.. and somehow use that instead of a DataReader.. but that didn't work.. I tried using a DataReader and get the byte array - but that wasn't right. SQL returns formatted XML, I need to load that XML into an XmlDocument somehow without ANY molestation of that dom. Any ideas? Examples? Missing links???? thanks THANKS!! I've been looking for the answer to ...

Update multivalue field in table from form with SQL
Access 2007 on Vista I am using a form to establish the variables for a report before it is created. One field on the underlying table is a multivalue field, and the form includes a multi-select combo box control. After selections are made and the OK button on the multi-select combo drop down is clicked, focus moves to the next control. I have discovered though, that the underlying table does not update immediately, but does so correctly when I close the form. This sequence does not deliver the proper report data, so I need a way to immediately update the underlying table (m...

Refer to SQL statements globally
I have two large SQL statements that I need to use across several forms, reports, etc. Rather than repeat them in each form, I'm trying to store and reference them globally. For example, I'd like to store strSQL1 and strSQL2 in a global module, so I can use either like this in a form: Random form: Me!lstResults.RowSource = strSQL1 Random report: Me.Report.RecordSource = strSQL2 Would I just store the SQL statements in a global module like: Public Function SQLSource() As String Dim strSQL1 As String Dim strSQL2 As String strSQL1 = "SELECT blah blah...

To SQL or not to SQL?
I have a very vertical product developed 100% in M/S Access. I developed it myself in 1993 in the initial release of Access and been with it ever since. It is currently very stable and running in Access 2003. My big question is how or even *if* we should move it to SQL. My customers are getting bigger all the time with more users. Typically our customers run one or two workstations generally never more than 5. Performance, however, is starting to slow with database sizes passing 500 meg. We also have a LOT of code behind forms so are bound tightly to the Access development environ...

total appointments allowed to enter in all day events month view
i can enter 8 or 9 appointments but can only view 7 when i print the calendar That's normal. Try a word template or a utility - information at http://slipstick.me/calprint -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com/ Outlook Tips by email: mailto:dailytips-subscribe-request@lists.outlooktips.net EMO - a weekly newsletter about Outlook and Exchange: mailto:EMO-NEWSLETTER-SUBSCRIBE-REQUEST@PEACH.EASE.LSOFT.COM New Poll: What type of email account is your main account? htt...

PostgreSQL or other SQL servers in RMS
Has anyone successfully implemented RMS with one of the free SQL servers? Theoretically, is there any reason why we have to use MS SQL Server 2000 for large databases? David "dh" <dh@discussions.microsoft.com> ha scritto nel messaggio news:1783A90D-AF3E-4D91-A445-0039D4E7E379@microsoft.com... > Has anyone successfully implemented RMS with one of the free SQL servers? > Theoretically, is there any reason why we have to use MS SQL Server 2000 > for > large databases? RMS has implemented only for MS SQL Server (2000/MSDE) and isn't possible to work with ano...

writeback to SQL 2005
hello! I use excel 2007 iI open a connection agianst SQL server 2005 and choose a table. In my workbook i can now see this data from this table. if i change a value in some cell i wish to writeback to table in SQL server. Is this possible? It's possible through the use of VBA and ADO, but not simply using the data connection you've already established. Ross "CJ" <CJ@discussions.microsoft.com> wrote in message news:D54EC521-0DD5-4B3D-971B-4FF3394D6FA8@microsoft.com... > hello! I use excel 2007 > iI open a connection agianst SQL server 2005 and choose a table...

sql.request #2
Does anyone have a comprehensible guide on how to use it that a dolt like me can follow? Every time I try I get a #N/A. The only guide I can find is at http://www.bygsoftware.com/examples/zipfiles/UsingSqlRequest.zip but it's really hard to follow. From the MSDN Library: http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/office97/html/SEC41.asp Not sure how familiar you are with ODBC; but if you are getting #N/A as a result, it is usually because of problems either with the SQL syntax or the connection string. There are a few examples of connection strings in the re...

MSDE or SQL Personal or SQL Developer? or SQL Workstation?
Hi, which one is better for personal non-server computer? MSDE? SQL Personal? SQL Developer? SQL Workstation? Thank you. It depends on what edition of GP you are going to run. If you are going to use Professional, you need to go with SQL Server developer, assuming you are installing on a non-server OS. "ano" wrote: > Hi, which one is better for personal non-server computer? MSDE? SQL Personal? > SQL Developer? SQL Workstation? > Thank you. Is the function of SQL Developer the same as Enterprise edition? How about personal edition? Can it be used for GP Pro? Can dev...

Excel RoundUp in Transact-SQL
Last week I posted the following computation in Excel... roundup(roundup(rate * 500),4) - roundup(rate * 200,4) + polfee,2) ((6.108934 * (500000/1000)) - (200 * 6.108934) + 1311.51) = 3144.20 In SQL using round(num,4) = 3144.19 I've moded this to... round(num+0.0005,4) = 3144.20 This works most of the time but occasionally I'm still off from what Excel returns. I'm under 2% in my 342 calcs, so it's do-able and we'll explain if any client notes this that we've reduced their pmt by .01 cents. BUT, I'd still like a way to replicate Excel'...

GP 9.0 on SQL 2008
MBS has said GP 10 is supported on SQL Server 2008. However there is no information on support for GP 9.0 on SQL 2008. Does anyone have any real-world experience running GP 9.0 on SQL 2008 in a production environment? Thanks, John Dynamics GP 9.0 is not supported on Microsoft SQL Server 2008. This is an excerpt from the System Requirements page. Database Requirements: MSDE 2000 SP 4 Microsoft SQL Server 2000 Enterprise Edition SP 4 Microsoft SQL Server 2000 Standard Edition SP 4 Microsoft SQL Server 2000 Workgroup Edition SP 4 Microsoft SQL Server 2000 (64-bit) SP 4 Microsoft SQL Serve...

SQL
Hi, i am new in Sql express i am trying to create a database in sql but i dont now how can i install the database in other computer or a server programmatically where the other computer have the sql and if is a server what i nead to do . or only what i need is a valid conection ; i use the localhots to identify any clinte machine but i dont now what i need to writh for the servers my conection is look like this as a defualt from MFC hr = _db.OpenFromInitializationString(L"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Data.mdf;Data Sour...

Day of week?
In Outlook 2002, using Day/Week/Month view to see my appointments, each day 'square' is headed with the date, e.g. '01 November'. How can I add the day please, so that I see 'Monday 01 November', or better, 'Monday 1 November'. (Maybe even 'Monday 1st November?) -- Terry, West Sussex, UK Change your long date settings in Control panel, regional settings. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Author, Google and Other Search Engines (Visual QuickStar...

calculating pay rates for different times of the day
hi there i am new to this so please dont shout at me,i'm using office 2007. i'm after an easier way for me to calculate my pay i work odd shifts crossing over time zones. what i'm needing is to be able to calculate different pay rates. i.e pay rates from 0600 to 1800 are paid at £8 an hour after 8 hours going onto £12 an hour, after 1800 this goes into night rate of £9 before 8 hours then goes too £13.50 an hour for remainder. Example: 14:00 to 03:00 -45 mins break = 12.25 hours, would work out like this 14:00 to 18:00 = 4*£8 18:00 to 22:00 = 4*£...

Access frontend with SQL Server backend: my solution for ODBC Call error
Hi This thread follows threads I started in forums microsoft.public.access.forms, and microsoft.sqlserver.programming: 1. 'Overriding constraint violation message' at 21.04.2010 12:00; 2. 'Overriding constraint restriction message, when deleting record(s) from form' at 29.04.2010 10:36. The problem (Occurs in Access 2000 mdb as stated by MS and in Access 2007 mdb as I myself discovered): When record operation is aborted from SQL Server, Access gets the full information about error, but this info gets unaccessible at moment when OnError event is triggered. The...

SQL Study Group
sql-study-group@googlegroups.com Please join for support our SQL Study Group ------=_NextPart_0001_3CECC08E Content-Type: text/plain Content-Transfer-Encoding: 7bit For those who want to join, the URL is http://groups.google.com/group/sql-study-group David Musgrave [MSFT] Escalation Engineer - Microsoft Dynamics GP Microsoft Dynamics Support - Asia Pacific Microsoft Dynamics (formerly Microsoft Business Solutions) http://www.microsoft.com/Dynamics mailto:David.Musgrave@online.microsoft.com http://blogs.msdn.com/DevelopingForDynamicsGP Any views contained within are my personal views a...

SQL 2008 and SRS
I am using SQL 2005 with CRM 4.0 on one box and have to move CRM and SQL to seperate boxes. The SQL box will have SQL 2008 Standard. The consultant who will be doing the SQL work reminded me to install SRS. Is SRS included with SQL 2008 Standard? Thanks, John SQL Server Reporting Services (SSRS) is part of 2008 Standard Edition. RLF "John" <bsmith@aol.com> wrote in message news:%23DpI1bfcKHA.808@TK2MSFTNGP02.phx.gbl... >I am using SQL 2005 with CRM 4.0 on one box and have to move CRM and SQL to >seperate boxes. The SQL box will have SQL 2...