Question: We're currently using SQL Express on SQL Server 2005 and want to set up an automated ftp file transfer every two hours to our client. We want to be able to send them bi-hourly uploads without duplicates throughout the day. Is this possible to do by modifying this existing query?

```
    Use Sweet
    select distinct d.AccountCode, f.ProcessedFileName, f.CallStartDateTime, f.PathToFile 
    from CSR_CallDetail d, CSR_FileListing f
    where d.CallId = f.CallId 
    and f.ProcessedFileName like '%mp3'
    and f.CallStartDateTime between convert(varchar(10),getdate()-1,101) and convert(varchar(10),getdate(),101)
    and d.AccountCode > '740000'
    and f.AccountCode > '740000'
    and not exists (select 1 from( select processedfilename from csr_filelisting) p 
                                 where f.compressedfilename = p.processedfilename)

```

Here's the updated query

```
    Use Sweet
    select distinct d.AccountCode, f.ProcessedFileName, f.CallStartDateTime, f.PathToFile 
    from CSR_CallDetail d, CSR_FileListing f
    where d.CallId = f.CallId 
    and f.ProcessedFileName like '%mp3'
    and DATEDiff(hh, f.callstartdatetime, GETDATE ()) <=2
    and d.AccountCode > '740000'
    and f.AccountCode > '740000'
    and not exists (select 1 from( select processedfilename from csr_filelisting) p where f.compressedfilename = p.processedfilename)

```

Answer: 
I discovered that if the app was installed *prior* to running my test, it didn't complain about the Activity being absent.

And if I launch appium with `appium --full-reset` it uninstalls the existing app and then installs *some* apk and finds the Activity.
```
Does not clear the app data and launch the app from the desire activity      
DesiredCapabilities capabilities = new DesiredCapabilities();
     capabilities.setCapability("deviceName","Galaxy E7");
                   capabilities.setCapability("platformName", "Android");
                   capabilities.setCapability("version", "5.1.1");
                 capabilities.setCapability("noReset", true);
                 capabilities.setCapability("fullReset", false);
               capabilities.setCapability("app", "D:/Builds/RSQuare_Live.apk");
                 capabilities.setCapability("app-wait-activity", "com.rr.consultants.base.SpalshScreenActivity");

```