Select the one record with the latest record

I have the following table called tblSales:
SKU   TransDate   Color
===   ======  ====
123   1/1/2015    Red
123   1/2/2015    Red
123   1/5/2015    Red
123   1/1/2015    White
123   1/2/2015    White
123   1/3/2015    White
123   1/1/2015    Blue
123   1/2/2015    Blue
123   1/5/2015    Blue
I need to create a query along the lines "SELECT the latest record FROM tblSales WHERE Color = 'White''
In this example, the record dated 1/3/2015 would be the result.  I know that MAX(TransDate) is used here, but not sure how.
Thanks.
Ken

Karl,
I had already tried that.  It returns all 3 records having SKU = 123 and Color = White.
Worst case scenario is I can always search for White 123s using a query with TransDate DESC and then get the first record.  I was just hoping for something a bit more elegant.
Thanks for your help though.
Ken

Similar Messages

  • I'm trying to change my ICloud e-mail to match the one associated with the Apple ID? Can someone tell me how to do this? Seems like the phone won't accept the new one, the message states "you already have acct associated....."  (a given!!)  I need help !!

    I'm trying to change my ICloud e-mail to match the one associated with the Apple ID? Can someone tell me how to do this? Seems like the phone won't accept the new one, the message states "you already have acct associated....."  (a given!!)  I need help !!

    You made a purchase and exhausted the credit on your card before it processed. All purchases are final. Contact iTunes Store support. You need to settle up before you can purchase or download anything else.

  • HT204053 I originally had an Apple ID when I got my iPad.  This is the one associated with the app store; however, I now have two.  The second one comes up when I try to log into the app store and it will not log me in.  How do I get the original one to s

    I'm beginning to feel totally frustrated and functionally illiterate. I've been trying to log into the app store.  The apple Id that shows is not the original one I set up when I got my iPad.  When I enter the password for the Id that shows, I get the message that I cannot log in.  Is there a way for me to change which id shows up?
    Any help would be greatly appreciated. 

    Open the App Store app, go to the Featured pane, swipe to the bottom, tap the Apple ID and sign out. Tap again and sign in with the Apple ID of your choosing.

  • HT201343 i have a mid 2010 mac pro and the fact that it have most of the components as the ones compatible with the airplay mirroring mine does not work ?

    i have verify that all the components are almost the same please advice why because i was able to previously airply movies why not now that i have the latest os x mountain lion

    iTunes airplay still works as it always has.
    AirPlay Mirroring (the ML-added feature) requires the latest Intel hardware (specifically the Intel HD Graphics subprocessor).  This hardware includes a feature called QuickSync Video (similar to HDMI-over-wifi).
    There is no 'almost' have it.  Either you do or you do not.  It wasn't an arbitrary decision by Apple to deny older Macs of this hardware feature.

  • Is the version of Illustrator CS6 installed the same as the one included with the Creative Cloud?

    I have been using AI CS6 on a mac 10.8.2, since it came out. I recently updated to Crative Cloud. Adobe download manager says AI is installed. So I assume the version I have been using is the same one you download in Creative Cloud?

    I have branched this out to a separate discussion.
    WisconsinDan the versions are pretty much identical at this point.  We did release a feature update for Creative Cloud subscribers for Illustrator.  You should be able to access the update by going to Illustrator and select Help>Updates.  Alternately you will be notified of the update as part of the daily check for updates process.

  • Finding the record with the latest date

    Post Author: sconlon
    CA Forum: General
    Hi,I am using CR 8 with an Access database which has a table that holds (multiple) sales records for each of our clients. I want to create a report that lists only the latest sale from each client.  I am thinking that I first need to group by client and then create a sub-report that prints the necessary details of sales record with the latest date of sale.  It's this last bit that I cannot figure out how to do.  Can anyone suggest a way of doing this?Many thanks,sconlon

    Post Author: Jagan
    CA Forum: General
    Charliy's suggestion if fine, and does require sorting and displaying in the group header/footer according to the sort order. In case it's not clear, when you print in the group header you are using the first record's data; when you print in the group footer you are using the last record's data (first and last within the group that is).
    Personally, I'd group on the client have a group selection formula of:
    {table.date_field} = maximum({table.date_field}, {table.client_id})
    so that there's no date sort required as you'll only get one record per client group - assuming that each record has a unique date of course. I'd probably still suppress the details section and display in the group footer, but it wouldn't matter if you use the details section either.
    I believe the benefit with the group selection formula is that any summary formulas, running totals etc. you use would only have the one record per client to work on, rather than including all of the suppressed records too.

  • DTP error: No Message: Filter Out New Records with the Same Key

    Hello SDN,
    I have looked up solutions for this problem, but didnt find anything suitable. I am getting this error in multiple places: when i load pure master data into IOs like 0VENDOR, 0PLANT etc. or when I load DSOs like 0FIAP_O03.
    When I checked the load in sdn, one of the solutions was to apply note: 1489178 , but in this case, the user had nothing selected in his 'semantic key' list. Whereas, in my case.. 0PLANT is checked ...eventhough the other fields are disabled. So, I think my DTP is accurate.. as 'plant' is the only key field here.  But it still fails .. and so does 0VENDOR load. Moreover... the DSO load is crucial for our reports in Prod and its failure is a bigger issue for us.
    Has anyone seen this problem? Is there another solution other than the above note?
    Regards.

    Hello Arvind,
    If I select that option, will it delete one record if it finds 2 records with the same semantic key in 1 data packet. Also, will it delete a record if it finds that there is already a record existing in the data target with the same semantic key.
    I think, both of the above scenarios will result in incorrect data. From my understanding, 'Handle Duplicate Keys' is mostly used to filter out master data.. as in some instances.. you might get duplicate entries.
    But, in my case, the same error is happening in the case of data load from 0fi_ap_4 --> 0fiap_o03. What happens is... the overall status of the DTP becomes green.. but when you look at details section, the process stops at this message which is in yellow. Because of this, the DTP status in the PC remains yellow.. and finally turns red.. and the PC turns red.
    From my knowledge, it appears more like a bug. I was hoping to find a SAP NOTE which has some manual instructions that can resolve the issue, since the above NOTE asks for a support pack upgrade.. which would need a whole lotta testing.
    Regards.

  • Send emails from a csv file (grouping records with the same email addresses)

    Writing a script to send emails from a csv which contains record details and email addresses using the Send-Mailmessage cmdlet.
    That part is no trouble, however, the csv file contain records that can have the same email address.
    Is there a way/method I could send the records with the same email address once instead of sending individual email messages?
    Thanks
    Data in the csv file
    Record number, description, email
    1234, Test 1, [email protected]
    5678, Test 2, [email protected]
    1245, Test 3, [email protected]
    4578, Test 4, [email protected]
    $data = Import-csv c:\records.csv
    ForEach($address in $data)
    Send-mailmessage -To $address.emails -from [email protected] -subject "List of records" -Body $data -SmtpServer 192.168.1.1

    The following code does what you are looking for:
    $data = Import-csv c:\records.csv$mx = "192.168.1.1"
    $subject = "List of records"
    $from = "[email protected]"
    $data| Group-Object email|Select-Object Name, @{n='msg'; e={$_.Group| Select-Object -Property "record number", description|ConvertTo-Csv -notypeinformation|Out-String}}|
    ForEach-Object {Send-MailMessage -to $_.Name -Body $_.msg -SmtpServer $mx -Subject $subject -From $from}
    I also recommend no forcing everything into one line.  "One-liner" means "one pipeline" not putting all code on one unreadable line.
    Your code should look like this:
    $data|
    Group-Object email|
    Select-Object Name, @{
    n='msg'; e={
    $_.Group| Select-Object -Property "record number", description|
    ConvertTo-Csv -notypeinformation|Out-String
    }|
    ForEach-Object {
    Send-MailMessage -to $_.Name -Body $_.msg -SmtpServer $mx -Subject $subject -From $from
    Now we can see the code and see that you are still unnecessarily converting back and forth.
    To get the group look at how I did it.
    $body=$_.Group | Format-Table |Out-String
    Isn't that much easier?
    Once you master the pipeline these things will become second nature.  In PowerShell it is not necessary to write lots of code most of the time.
    ¯\_(ツ)_/¯

  • Hi I shoot on a canon 5d mk11 and I record my audio on an external device yet when I open up my footage in final cut pro x I can't find my external audio files only the ones attached to the clip which are off the camera mic

    I shoot on a canon 5d mk11 and I record my audio on an external device yet when I open up my footage in final cut pro x I can't find my external audio files only the ones attached to the clip which are off the camera mic

    What device?
    What format?
    How are you importing it?
    Can you find the external audio with Finder?
    Where is your destination file when you import it?
    Andy

  • Anyone know how to get to the setting so i can record with the keypad instead of the mouse?thanks

    Anyone know how to record with the computers keyboard on logic rather than the mouse on piano roll?

    this is a follow up from the profane post earlier....
    i have done this twice in two other posts..
    here is my problem.. i started off trying to update itunes, it failed twice and said i needed to install manually via tools.
    the only place to get to tools is the pop up box that appears when you click check for updates.. if there is an available update then the pop up shows up with the quick time and itunes files to download. so i finally figured that out. i clicked on tools and manual update, four files were saved to a file. Apple mobile device support, another one similar, itunes, and another one i cant remember. I only downloaded the itunes file seeing as though thats all i needed to accomplish in the first place.
    so then i restarted my computer bc you need to reboot and then reopen itunes for update to take effect. once i have itunes back open i plugged in my new 5s which i am trying to sync to my computer to get all my stuff back bc i lost my previous phone over the weekend.. once i plugged the phone in an error stating i needed to unistall the apple mobile device support and itunes and then reinstall. well i dont know where those files were originally stored on my computer AND since my itunes was updated, just not the other 3 associated files, when i click check for updates it says its up to date and then pop up containing the quick time and itunes does not pop up thus i cant get back to the tools tab to manually save the 4 files again.
    so i was just going to uninstall itunes all together and then i thought well what happens if it erases all my photos apps songs etc... which would defeat the whole purpose in the first place of me trying to sync my new phone to get all my stuff back.
    so i literally have no idea what to do at this point.. if you have read this you are probably just as confused as me...

  • I have garagaband for iOs in my iPhone 4S, I connect my squire iOs guitarr to the iPhone, I select a Guitar Amp at the GB app then I Only can tune the guitar but I m not able to make the guitar ring with the amps. May some one help me?

    I have garagaband for iOs in my iPhone 4S, I connect my Squire iOs guitarr to the iPhone, I select a Guitar Amp at the GB app then I Only can tune the guitar but I m not able to make the guitar ring with the amps. May some one help me?

    You got the new iphone?????   I have same problem.  I transferred audiobooks to device to find no audiobooks on device (despite it being in iTunes as if it was).  Have you found a solution?????   I even tried to change import settings on format transfer but hasn't worked. 

  • Reducing time while Filtering Out New Records with the Same Key

    Hi Experts,
    I have an issue .. I am trying to load data into 0MATERIAL . While loading via DTP the step u201CFilter Out New Records with the Same Keyu201D   takes much time for processing . For each datapackage it is taking around 30 minutes to filter out new records with the same key .  While for other master data it hardly takes 5 minutes.
    Any pointers how to reduce the timeu2026
    Thanks in advance
    Sam

    Hello,
    No there is no need to do that change then.
    Can you tell me are you doing a full load daily to 0MATERIAL object.
    why dont you use delta.
    Also if the DTP is of type FULL, then are you deleting the previous PSA requests.
    Maybe you can ask the basis guys to check with a trace what is really happening on the DB side during this 30 mins and then maybe we can find the needed fix.
    Regards,
    Shashank

  • Problem viewing videos I recorded with the phone

    When trying to view videos I recorded with the phone, It gives me a message saying it is impossible to view this multimedia file format!
    It has been recorded with the phone and it can't watch it on the phone!? It doesn't recognize its own recording format
    Help please

    If the format is in 3GP you can view it with a player called VLC (http://www.videolan.org/vlc/), or can try a video conversion program to convert it into a format your computer can read. Once such program can be found here http://www.avs4you.com/AVS-Video-Converter.aspx
    If someone has been helpful please consider giving them kudos by clicking the star to the left of their post.
    Remember to resolve your thread by clicking Accepted Solution.

  • Recording with the SB Audigy 2 zs plat PRO external is horribly low volume... setup probl

    I have my guitar plugged into line /line 2 and whenever I enable recording, the sound that is recorded is incredibly low. I have to set my speaker and system volume to the max just to hear a little bit of sound(i have the 7. S750 creative speakers). I also experiance this with the mic i'm using. I'm using a cheaper professional Shure microphone and have it hooked up, via a XLR converter form radio shack, to my external SB hub. This mic requires no pre-amp and its turned on but the sound is also very low. I was wondering if this is normal, or if i'm missing some vital peace of information on how to record properly. Oh and also, I have the recording volume maxed in media source and on the external hub and I have also used the M-Audio: mobile pre usb, to record with the same guitar/microphone, and it sounded fine volume wise, what gives? my rate is 320 bits.

    OldPainless,
    I'm hoping that means that you found the connector and all is working now? I know it happens around here more often than we would like to admit. Frequently swapping out hardware leads to forgotten things like this.
    Daniel

  • Tagging records with the Map_Run_ID

    I load dimension tables incrementally. So the target dimension table only receives source records that have been inserted or updated since the last ETL run.
    I want to capture the mappings map_run_id (stored in the all_rt_audit_step_runs table) as a column in the target table. That way, I can associate the records in the target table with the operation that last touched them.
    I'm new to OWB. How do I accomplish this within a Mapping? I assume I need to reference the get_runtime_audit_id variable. But how? A constant or expression operator? Those don't work -- at least not if you just type the variable name. Is there another way?
    Thanks,
    David

    David,
    what was the problems with using constant and expression operator for get_runtime_audit_id? Describe this problem more precisely.
    Did you set option "Is predefined constant" in constant operator?
    Regards,
    Oleg

  • I record some information to some slides but the presentation doesn't start from the 1st one but from the one I started the recording. What should I do?

    I record some information to some slides but the presentation doesn't start from the 1st one but from the one I started the recording. What should I do?
    Also, can I use music as backround to some of the slides, not to all of them as I'd like to play videos on the others?

    I have reinstalled the drivers. I watched it install the realtec and cirrus drivers. Hovering the mouse over the speaker icon says 'speakers: HP'. They are actually 'Creative'. 'Properties' indicates 'IDT High Definition CODEC' and 'This device is working correctly'.
    Driver details gives 'c:\Windows\system32\drivers\dmk.sys'.
    There is still no sound, although the little level meter on the control shows a green bar rising and falling.
    Obviously, it thinks it's working, but there's no connection to the speakers. They're not muted, either. I checked that too.
    Any other ideas?
    Thanks.

Maybe you are looking for

  • Not able to run my first Servlet..... 404 error!!!

    Hi, I am new to Java. I am trying to create a small servlet application. I am using Tomcat 5.5 server and eclipse for this. I have first writtern a HTML form which on submission is redirected to a servlet that displays the information submitted. but

  • Clean install vs. time machine recovery after installing new HDD

    Hello All, I have got actually two questions, but I think I only can do one issue at the time. Anyway: Here are my specs and question: 1. I have got a 2010 MacBook Pro with a 320 Gb HDD which seems to be on its way to lala land (crashes almost once e

  • HT1476 how do u get ur ipod touch to charge with usb cord on the wall?

    my i pod wont charge on the wall or on my pc (computer) what do i do??????

  • Server is too slow

    I have oracle 9i database on sun solaris OS IBM server. 2GB RAM 4 hard disk 45 users are login in to the system. Its almost dead slow and some time user get out from the system.It is almost in hold sitution. When ever we restart the server all the pr

  • Mount ISO in OS X?

    Hi folks. Just wondering if there is a way to mount and ISO image in OSX. If not, is there a program that can decompress it? Thanks.