<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Another tiny mistake in SQL1: Essentials Course Note PDF - on page 107, in practice s102s03's an in SAS Certification</title>
    <link>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959378#M1853</link>
    <description>&lt;P&gt;Thanks for taking the time to explore.&lt;/P&gt;
&lt;P&gt;Looks like there is a problem. I would assume something changed either in the data or the question and they did not double check the results before publishing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am actually more concerned by the code you posted in your first screen shot that was reporting DATE values generated by the DATEPART() function but sorting by the original datetime values.&amp;nbsp; That is poor coding style.&amp;nbsp; As I pointed out before that will also cause SAS to generate a message into the log noting that issue of sorting by a value that is not included in the result set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Feb 2025 16:30:47 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2025-02-17T16:30:47Z</dc:date>
    <item>
      <title>Another tiny mistake in SQL1: Essentials Course Note PDF - on page 107, in practice s102s03's answer</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959183#M1840</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I think there is another tiny mistake in the answer for practice s102s03, on page 107 in SQL1: essentials course note PDF (screenshot is as below). The merchant name of December's first transaction is &lt;STRONG&gt;Sceneit Cinemas, LLC&lt;/STRONG&gt;, not &lt;STRONG&gt;Big Burgers, Inc&lt;/STRONG&gt;. I run both my code and code provided by the course note and had the same results (see below).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104606iD15AB71E6FAD3753/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title "November/December Transactions";
proc sql;
select customername label='Customer Name',
       merchantname label='MerchantName',
       amount label='Transaction Amount'
                    format=dollar10.2,
       datepart(datetime) as transactiondate
                    label='Transaction Date'
                    format=date9.
   from sq.transactionfull
   where month(calculated transactiondate)in(11,12) and
         service ^= 'University'
   order by datetime;
quit;
title;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled2.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104607i9DFBA096ED6CA941/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled2.png" alt="Untitled2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title "November/December Transactions";
proc sql;
select customername label='Customer Name',
       merchantname label='MerchantName',
       amount label='Transaction Amount'
                    format=dollar10.2,
       datepart(datetime) as transactiondate
                    label='Transaction Date'
                    format=date9.
   from sq.transactionfull
   where month(datepart(datetime)) in (11,12) and
         service ^= 'University'
   order by datetime;
quit;
title;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled3.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104608i3B1E8C8CA97FA4ED/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled3.png" alt="Untitled3.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Also, I can see from the first five rows that the above result table (see below, the lower one) is the same as the partial result table provided with the original question on course note PDF, page 65 (see below, the upper one).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled4.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104609iCF5F409DB5A13570/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled4.png" alt="Untitled4.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled5.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104610iD5A1E5D3ABCA37AF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled5.png" alt="Untitled5.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 14:15:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959183#M1840</guid>
      <dc:creator>dxiao2017</dc:creator>
      <dc:date>2025-02-13T14:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: Another tiny mistake in SQL1: Essentials Course Note PDF - on page 107, in practice s102s03's an</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959196#M1841</link>
      <description>&lt;P&gt;Your picture is showing at least six observations for 01DEC2018.&amp;nbsp; Why are you picking out the first one instead of one of the others?&amp;nbsp;&amp;nbsp;Remember that if you don't tell SQL how to order tied values then there is no assurance what order the tied observations will appear.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why are you displaying DATEPART() values, but ordering by the full DATETIME values?&lt;/P&gt;
&lt;P&gt;That might cause the order the be different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 17:31:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959196#M1841</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-02-13T17:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Another tiny mistake in SQL1: Essentials Course Note PDF - on page 107, in practice s102s03's an</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959208#M1843</link>
      <description>&lt;P&gt;Hi, the reason I picked out the first one was: among the several observations for 01DEC2018, that one is listed the first in the output table. And this is what the question asks I think. The question was to ask what was the value of the merchant name column in the first row (as it is displayed in the result table) for 01DEC2018. The order of the observations in the output table is completely defined by two things: 1) the original order of the observations in the input table and 2) the statements in the proc sql step including the &lt;EM&gt;order by&lt;/EM&gt; statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reason I display the datepart() value and order by the full datetime value is: that was what the question asks. I have read the question twice and confirmed it asks to order the results by the original date value(i.e., the full datetime value). Also I have even tried ordering by the calculated date value (i.e., the datepart() value) and the results was the same (and in fact, the results should be the same regardless I order by the full datetime value or the datepart() value), if I remember it right.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 18:38:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959208#M1843</guid>
      <dc:creator>dxiao2017</dc:creator>
      <dc:date>2025-02-13T18:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Another tiny mistake in SQL1: Essentials Course Note PDF - on page 107, in practice s102s03's an</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959217#M1844</link>
      <description>&lt;P&gt;If ordering by the DATETIME will be the same as ordering by DATE only then most likely all of the datetime values for 01DEC2018 have the same time of day part.&amp;nbsp; That is frequently the case as many database systems do not actually have a way to store DATE only values like SAS does so they store DATE values as DATETIME values with the time of day set to midnight (00:00:00).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Usually SAS will retain the original relative order of observations with the same values of BY groups. In fact PROC SORT has a option now where you can insist on it.&amp;nbsp; The language of SQL explicitly allows implementations the freedom to not do that, so I would not count on that behavior with SQL code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note that PROC SQL will issue a warning when you order by a variable not include in the output.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;272  proc sql;
273  select name,age+10 as ageplus10
274  from sashelp.class
275  order by age
276  ;
NOTE: The query as specified involves ordering by an item that doesn't appear
      in its SELECT clause.
277  quit;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 19:44:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959217#M1844</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-02-13T19:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Another tiny mistake in SQL1: Essentials Course Note PDF - on page 107, in practice s102s03's an</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959299#M1845</link>
      <description>&lt;P&gt;Hi Tom, you are right about the difference between ordering by original datetime or by calculated date value. I add the original datetime column into the output table, the difference are as follows (nevertheless the 1st record of 01DEC2018 remains the same, the merchant name of which is Sceneit Cinemas, LLC).&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Order by original datetime values (codes, first five rows, and the 1st record of 01DEC2018):&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title "November/December Transactions";
proc sql;
select customername label='Customer Name',
       merchantname label='MerchantName',
       amount label='Transaction Amount'
                    format=dollar10.2,
       datetime,
       datepart(datetime) as transactiondate
                    label='Transaction Date'
                    format=date9.
   from sq.transactionfull
   where month(datepart(datetime)) in (11,12) and
         service ^= 'University'
   order by datetime;
quit;
title;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled1.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104654iA04D1641B3D38D84/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled1.png" alt="Untitled1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled2.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104655i931EE3E6CB8CF60C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled2.png" alt="Untitled2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Order by calculated date values (codes, first five rows, and the 1st record of 01DEC2018):&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title "November/December Transactions";
proc sql;
select customername label='Customer Name',
       merchantname label='MerchantName',
       amount label='Transaction Amount'
                    format=dollar10.2,
       datetime,
       datepart(datetime) as transactiondate
                    label='Transaction Date'
                    format=date9.
   from sq.transactionfull
   where month(calculated transactiondate)in(11,12) and
         service ^= 'University'
   order by transactiondate;
quit;
title;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dxiao2017_0-1739627366662.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104656iF375DDF0FD41C7D8/image-size/large?v=v2&amp;amp;px=999" role="button" title="dxiao2017_0-1739627366662.png" alt="dxiao2017_0-1739627366662.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled5.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104657iD03A7615BCEC20F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled5.png" alt="Untitled5.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;There is a message in the log if I do not include the &lt;EM&gt;order by&lt;/EM&gt; variable in the SQL select statement, however, the message is just a NOTE (not a yellow WARNING), which is acceptable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Feb 2025 14:05:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959299#M1845</guid>
      <dc:creator>dxiao2017</dc:creator>
      <dc:date>2025-02-15T14:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Another tiny mistake in SQL1: Essentials Course Note PDF - on page 107, in practice s102s03's an</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959310#M1846</link>
      <description>&lt;P&gt;I don't have your data, but the question also includes the qualification of "documented transaction".&amp;nbsp; Is there another variable you should be filtering on that would distinguish documented from non-documented transactions?&lt;/P&gt;</description>
      <pubDate>Sat, 15 Feb 2025 17:09:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959310#M1846</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-02-15T17:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Another tiny mistake in SQL1: Essentials Course Note PDF - on page 107, in practice s102s03's an</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959311#M1847</link>
      <description>&lt;P&gt;Hi Tom, I think the word "documented" in the question means: what has been &lt;STRONG&gt;displayed&lt;/STRONG&gt; in the output table, or, the &lt;STRONG&gt;records&lt;/STRONG&gt; in the output table, or, what has been &lt;STRONG&gt;produced/printed out&lt;/STRONG&gt;&amp;nbsp;(as a record) in the output table. The question was to ask "what is the value in the &lt;EM&gt;Merchant Name&lt;/EM&gt; column in the first row for 01DEC2018 in the result table?", or "in the result table, look at the first record that has been displayed for 01DEC2018, what is the value in the &lt;EM&gt;Merchant Name&lt;/EM&gt; column?" It's a problem of English and do not really has anything to do with the dataset. I guessed the meaning of the question, and I guess I am the same nationality with the person who wrote that part of the material (in our language we often use the same one word for "&lt;EM&gt;documented&lt;/EM&gt;" and "&lt;EM&gt;recorded&lt;/EM&gt;" in a lot of scenarios, isn't it).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Feb 2025 17:56:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959311#M1847</guid>
      <dc:creator>dxiao2017</dc:creator>
      <dc:date>2025-02-15T17:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: Another tiny mistake in SQL1: Essentials Course Note PDF - on page 107, in practice s102s03's an</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959312#M1848</link>
      <description>&lt;P&gt;I do not have either the data or the questions so I cannot tell if the dataset you are supposed to query has a variable, such as status, that would indicate if something was only recorded into the database of if there was some addition documented status for the observation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another possible reason why the question wants you to pick a different observation is that it wanted you to sort by date (not datetime) and name.&amp;nbsp; If so then a name like Big Burgers that starts with B would come before any name that starts with an S.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input datetime :datetime. name $30. ;
  format datetime datetime19.;
cards;
01DEC2018:08:00  Some other name
01DEC2018:12:00  Big Burgers
;

proc sql;
select datetime,name 
from test
order by datetime,name
;
select datepart(datetime) as date format=date9.,name
from test
order by date,name
;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-02-15 at 1.13.17 PM.png" style="width: 404px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104666iB43D66524539587E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-02-15 at 1.13.17 PM.png" alt="Screenshot 2025-02-15 at 1.13.17 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;What were the exact instructions you were supposed to follow to produce the report you are then asked to examine?&lt;/P&gt;</description>
      <pubDate>Sat, 15 Feb 2025 18:14:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959312#M1848</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-02-15T18:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: Another tiny mistake in SQL1: Essentials Course Note PDF - on page 107, in practice s102s03's an</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959323#M1849</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;There is no such variable as status/documented in the input dataset. The question asks to order by original datetime value only and there is no any other order by variable. You are right about the order of the observations when ordering by both time and name variables. I tested ordering by both calculated date value and merchant name, the code and result are as follows (the one comes first for 01DEC2018 is &lt;EM&gt;Alar Air, Inc&lt;/EM&gt;, and then &lt;EM&gt;Big Burgers, Inc&lt;/EM&gt;. the second):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select customername label='Customer Name',
       merchantname label='MerchantName',
       amount label='Transaction Amount'
                    format=dollar10.2,
       datetime,
       datepart(datetime) as transactiondate
                    label='Transaction Date'
                    format=date9.
   from sq.transactionfull
   where month(calculated transactiondate)in(11,12) and
         service ^= 'University'
   order by transactiondate, merchantname;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled12.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104667i0EB8FE75F98FCF7D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled12.png" alt="Untitled12.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;When order by original datetime value and merchant name, the one comes first for 01DEC2018 is &lt;EM&gt;Sceneit Cinemas, LLC&lt;/EM&gt; again (this confirms that the earliest transaction occurred on 01DEC2018 was &lt;EM&gt;Sceneit Cinemas, LLC&lt;/EM&gt;, btw):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select customername label='Customer Name',
       merchantname label='MerchantName',
       amount label='Transaction Amount'
                    format=dollar10.2,
       datetime,
       datepart(datetime) as transactiondate
                    label='Transaction Date'
                    format=date9.
   from sq.transactionfull
   where month(calculated transactiondate)in(11,12) and
         service ^= 'University'
   order by datetime, merchantname;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled34.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104668i4260E92D22FA4F9E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled34.png" alt="Untitled34.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The code (both my answer and the answer provided by the course note PDF) in my first post exactly reflects the procedures the question asks to follow. I think the steps and procedures were phrased clear and not ambiguous in the question, except the "the first documented transaction" part. It would be better if the question explicitly asks to produce a report that examines what is the merchant name of the earliest transaction happened on 01DEC2018 (without showing the time part of the datetime value and display the date only).&lt;/P&gt;</description>
      <pubDate>Sun, 16 Feb 2025 17:57:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959323#M1849</guid>
      <dc:creator>dxiao2017</dc:creator>
      <dc:date>2025-02-16T17:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Another tiny mistake in SQL1: Essentials Course Note PDF - on page 107, in practice s102s03's an</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959324#M1850</link>
      <description>&lt;P&gt;What if you order by that first column, looks like Customer? within DATE?&lt;/P&gt;
&lt;P&gt;Does Big Burgers come first then?&lt;/P&gt;</description>
      <pubDate>Sun, 16 Feb 2025 17:58:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959324#M1850</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-02-16T17:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Another tiny mistake in SQL1: Essentials Course Note PDF - on page 107, in practice s102s03's an</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959347#M1852</link>
      <description>&lt;P&gt;Hi here you go (see below for code and results): when order by date and customer name, the 1st one for 01DEC2018 becomes Economical Superstore (and we know that no matter what is the second order by variable, if the first order by variable is the datetime value, the 1st one for 012DEC2018 will always be the cinema one which starts with S because it was the earliest transaction of that day. And therefore I insist that the answer for the question is the cinema one which starts with S, not the big burger one.&lt;/P&gt;
&lt;PRE&gt;proc sql;&lt;BR /&gt;select customername label='Customer Name',&lt;BR /&gt;       merchantname label='MerchantName',&lt;BR /&gt;       amount label='Transaction Amount'&lt;BR /&gt;                    format=dollar10.2,&lt;BR /&gt;       datetime,&lt;BR /&gt;       datepart(datetime) as transactiondate&lt;BR /&gt;                    label='Transaction Date'&lt;BR /&gt;                    format=date9.&lt;BR /&gt;   from sq.transactionfull&lt;BR /&gt;   where month(calculated transactiondate)in(11,12) and&lt;BR /&gt;         service ^= 'University'&lt;BR /&gt;   order by transactiondate, customername;&lt;BR /&gt;quit;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled56.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104676i668B024236F51742/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled56.png" alt="Untitled56.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 10:58:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959347#M1852</guid>
      <dc:creator>dxiao2017</dc:creator>
      <dc:date>2025-02-17T10:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: Another tiny mistake in SQL1: Essentials Course Note PDF - on page 107, in practice s102s03's an</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959378#M1853</link>
      <description>&lt;P&gt;Thanks for taking the time to explore.&lt;/P&gt;
&lt;P&gt;Looks like there is a problem. I would assume something changed either in the data or the question and they did not double check the results before publishing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am actually more concerned by the code you posted in your first screen shot that was reporting DATE values generated by the DATEPART() function but sorting by the original datetime values.&amp;nbsp; That is poor coding style.&amp;nbsp; As I pointed out before that will also cause SAS to generate a message into the log noting that issue of sorting by a value that is not included in the result set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 16:30:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959378#M1853</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-02-17T16:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Another tiny mistake in SQL1: Essentials Course Note PDF - on page 107, in practice s102s03's an</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959394#M1854</link>
      <description>&lt;P&gt;Hi, Tom:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; You're right, if the student is looking at an older version of the course notes, there's a chance that the data and/or the class changed between that version of the course and the current version of the course. When I check the current e-learning version and classroom version of the SQL course notes, the correct answer for that practice is provided as Sceneit Cinemas, as shown below (problem on white background, solution on blue background):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1739817657924.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104686i9A57CC6AED3CDD4C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1739817657924.png" alt="Cynthia_sas_0-1739817657924.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I'd suggest that the student take a look at the newest version of the course because typically with each release of a course, we correct errata items from the previous version and might change the practices and activities and demos based on student and instructor feedback.&amp;nbsp; That looks like what happened in this case. My guess is that the student in this case has an older PDF copy of the course notes, possibly from a SAS 9.3 or early 9.4 version of the class).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 18:44:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959394#M1854</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2025-02-17T18:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Another tiny mistake in SQL1: Essentials Course Note PDF - on page 107, in practice s102s03's an</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959396#M1855</link>
      <description>&lt;P&gt;Is there any reason why the course would ask the students to order a report by a variable that does not appear in the report?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 19:16:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959396#M1855</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-02-17T19:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Another tiny mistake in SQL1: Essentials Course Note PDF - on page 107, in practice s102s03's an</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959399#M1856</link>
      <description>&lt;P&gt;&amp;nbsp;Tom:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; In reviewing the instructions for this practice in the most current version of the course (and from teaching the course) -- we cover a lot of items, such as ordering, working with functions and date/datetime variables, creating new columns and subsetting with a WHERE in this section. There are multiple lectures on each of these topics. My sense of the exercise is that it is meant to pull together multiple concepts that were taught into one practice:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1739820241869.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104688iFC1C198DDEB4FAE2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1739820241869.png" alt="Cynthia_sas_0-1739820241869.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I frequently have students who get data from their databases with datetime values but they only want the date to be visible or they need to use a function on the value from DATEPART to get month or year (for example). So this practice was intended for the student to use the DateTime variable in the creation of the new column Transaction Date. I think that the original problem of the Big Burgers vs Sceneit Cinemas as the right answer did not have so much to do with the query itself, but with the version of the course and the version of the course notes. I don't have access to the older errata that was fixed for the course either, so that might have been a factor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Cynthia&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 19:29:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959399#M1856</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2025-02-17T19:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Another tiny mistake in SQL1: Essentials Course Note PDF - on page 107, in practice s102s03's an</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959488#M1857</link>
      <description>&lt;P&gt;Hi Cynthia, thanks a lot for clarifying and information, I indeed was looking at the pdf(of not updated version) instead of the html webpage. I accessed the online course material through 7 days free access and now I am using the course note pdf without accessing the e-learning version. And as an "old" learner (I got my BA and out of college almost 30 years ago, btw &lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;) I think this community is very helpful.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 15:10:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959488#M1857</guid>
      <dc:creator>dxiao2017</dc:creator>
      <dc:date>2025-02-18T15:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Another tiny mistake in SQL1: Essentials Course Note PDF - on page 107, in practice s102s03's an</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959508#M1858</link>
      <description>&lt;P&gt;Hi Tom, (since I bring up all this discussion) for your last question, this is my understanding so far: the basic idea of designing that question was to let learners practice create variables, use formats, select rows, and order observations according to the datetime variable (so that the answer can be verified through the earliest transaction on 01DEC2018). And then there was feedback from learners suggesting that learning to display only the date without the time part was necessary, and the datepart() function was added into the question, but ordering by original datetime remain unchanged. While update the materials, something also changed either with the datasets or the question (which asks to pick a row or column value to verify learners' answer), and these lead to the answer for the question became big burger in that version of pdf which was produced then.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 17:32:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959508#M1858</guid>
      <dc:creator>dxiao2017</dc:creator>
      <dc:date>2025-02-18T17:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Another tiny mistake in SQL1: Essentials Course Note PDF - on page 107, in practice s102s03's an</title>
      <link>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959544#M1859</link>
      <description>&lt;P&gt;Hi Tom, I agree with you on this point, although it generates only a NOTE (not a WARNING), I do not feel comfortable to order my data (especially when the dataset and output table are my final product) by a variable that is invisible or not shown, I always need to see it and be certain with the data and codes.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 19:55:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Certification/Another-tiny-mistake-in-SQL1-Essentials-Course-Note-PDF-on-page/m-p/959544#M1859</guid>
      <dc:creator>dxiao2017</dc:creator>
      <dc:date>2025-02-18T19:55:51Z</dc:date>
    </item>
  </channel>
</rss>

