.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

using two CTE's and copmareing today's price and tomorrow's price

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :Sql Server
I am trying to create a result set that compares prices for a selected dates with with prices for the next day and choose only prices which have changed but I keep getting an error " Subquery returnced more that 1 value...etc...   Declare @date datetime set @date = '2010-08-11' ;with CURRENT_PRICES AS ( SELECT PCC.EM_ITEM_NUM , ITM.NDC_NUM NDC , ITM.SELL_DSCR DSCR , CASE WHEN (PCC.E10_COST = 0 OR PCC.E10_COST IS NULL) AND (PCC.SG_CNTRC_BID_PRC = 0 OR PCC.SG_CNTRC_BID_PRC IS NULL) AND PCC.E10_COST > 0 AND PCC.SG_CNTRC_BID_PRC > 0 THEN 'Y' ELSE 'N' END OS_ADD , PCC.PRC_EFF_DT EFF_DT , PCC.PRC_END_DT END_DT , ISNULL(PCC.AVG_WHSL_PRC,0) CUR_AWP , ISNULL(PCC.WHSL_ACQ_COST,0) CUR_WAC , ISNULL(PCC.HOME_ACQ_COST,0) CUR_SF , ISNULL(PCC.E10_COST,0) CUR_SSF , ISNULL(PCC.SG_CNTRC_BID_PRC,0) CUR_SDC ,ISNULL((select prc from geprs_price..t_prc where prc.PRC_TYP_ID = 43 AND @DATE BETWEEN prc.PRC_EFF_DT AND prc.PRC_END_DT GROUP BY PRC),0) AS CUR_ACUTE_SSF , ISNULL((select prc from geprs_price..t_prc where prc.PRC_TYP_ID = 41 AND @DATE BETWEEN prc.PRC_EFF_DT AND prc.PRC_END_DT GROUP BY PRC),0) AS CUR_LTC_SSF , ISNULL((select prc from geprs_price..t_prc where prc.PRC_TYP_ID = 124 AND @DATE BETWEEN prc.PRC_EFF_DT AND prc.PRC_END_DT GROUP BY PRC),0) AS CUR_VET_SS

View Complete Post

More Related Resource Links

how can I change default errormessage for invalid price

I have:[Required(ErrorMessage = "Price is required.")]public decimal price { get; set; }How can I change default message for invalid price - I would like to change default error message "The value '45,8asasa' is not valid for Price.".

Javascript price update ...hidden field ... asap

Hello Experts http://store.apple.com/us/configure/MC374LL/A?mco=MTc0Njg1ODA Like in this link i created a javascript function  === id , lenght , width , dept , capacity ,price ..<script type="text/javascript">function getproductdetail (id,len,wid,dep,cap,thick,prc)     {          document.getElementById('row1')=prc   }          </script>the same function is called at a new place where i pass only price .. i have to check if there is a price is present in 'row1' i have to add new prc to present one .. =================== thing is where i will retain the old value present .. How to check whether value is prsent in row1 or not ..... if i will choose hidden field where to use and how to check value for that ... Thanks

Visual Studio .NET: What You Need to Know Today About the New and Upgraded Features in Visual Studio


Any time an upgrade of a favorite tool is released, questions about compatibility, versioning, and changes in methodology abound. The release of Visual Studio .NET 2003 is no exception. Developers will be relieved to learn that breaking changes have been kept to a minimum, and delighted to learn that important new features, like Visual J#, have been added. These and other new features of the .NET Framework 1.1 and Visual Studio .NET 2003, including mobile support and improved debugging, are discussed here.

Carl Franklin

MSDN Magazine March 2003

Windows XP Overview: Take Advantage of New Windows XP Features in Your Apps Today


Windows XP includes both improvements to the operating system and several new features that enhance the user experience. The most noticeable change in Windows XP is the user interface, which includes a revised Start menu and updated Task Bar. The new look is possible because Windows XP can be skinned, which lets the interface be changed dramatically with a new facility called themes. Windows XP also introduces fast user switching, which allows multiple users to be logged onto their own sessions at the same time on the same machine and, as the name implies, they can switch back and forth quickly. Another new feature, ClearType, is discussed here as well.

Douglas Boling

MSDN Magazine November 2001

dropdownbox which selects records based on criteria (TODAY, THIS WEEK, THIS MONTH, etc)


I have a dropdownbox which I want to use to search records based on a timescale. The gridview populates results based from that search.

So here is how I want to work this;

If a user selects "today" - a list of records input today are populated. If "this week" is selected, a list of all records added within that week from todays date is populated.

I created a forum on this issue previously but to no avail whatsoever. How do I work around this problem?

Help would be much appreciated

Preparing for SharePoint 2010 Upgrade Today

The SharePoint product team has provided guidance on a number of items that can help organizations prepare, and Service Pack 2 includes a key tool that can provide additional insight and configuration information. This paper, by Quest SharePoint senior architect and evangelist Joel Oleson, walks you through using this key tool and offers major items to consider as you prepare for a SharePoint 2010 upgrade.

dynamic 'Today field' in sharepoint


how to do i get a dynamic 'Today field' in sharepoint?

I found many examples such as this which is completely wrong.  In the example below the [Today] is only calculated on item creation and edit, not every time list item is accessed.
http://blogs.msdn.com/b/sharepointdesigner/archive/2008/08/01/date-functions-in-calculated-fields.aspx .

This is very important my customer wants it done asap.


Thank you.



nothing for members to see

Today only: Julie Lerman's Entity Framework eBook is $9.99

Today only (Monday August 30th 2010), you can get Julie Lerman's Entity Framework Second Edition book that was just published for a mere $9.99 US (eBook version). Go here: http://oreilly.com/catalog/9780596807269 Use this promo code: DDPEF (Monday August 30th 2010 ONLY) var addthis_pub="guybarrette";

rendering today's date through DVWP and modifying the XSLT

I need the Current date or Today to do some simple calculations(calculated columns) such as this: =IF(AND([Due Date]< [today], [today] < ”[Due Date]”),”Red”, “Green”) Question is: To can I convert the above formula so that it works in XSL modifying the XSLT. I new at this and not sure about the syntax. Can anyone help? I am thinking it would be something like this: <xsl:choose> <xsl:when test="ddwrt:Today() &gt; @DueDate"> <xsl:text>Red</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>Green</xsl:text> </xsl:otherwise> </xsl:choose> Obviously something is wrong with the code above...i don't get anything in return.   Thanks Cnothing for members to see

Today() Function including timezone causing issues in Analysis Services

I'm using Reporting Services 2008 R2 connecting to Analysis Services. I've used this same code without issues before (pre R2), just wondering whether it is an RS, AS, Server or some other issue entirely. I have a report with a datetime parameter @vdtmDate (I use this so the user has the date picker instead of a drop down list of dates) with default =DateAdd(DateInterval.Day, -1, Today()) Then in the MDX for the dataset, I use the following to build the filter. SET [Today] as STRTOSET('[Calendar].[Reporting Week].[Day].&[' + VBA.FORMAT(VBA.CDATE(@vdtmDate),'yyyyMMdd') + ']') The issue I'm having is when the report runs with the default parameters, the value passed to Analysis Services includes the timezone which causes the query to process for the previous day to that selected. When the user runs the report manually (ie just pressing the view report button straight after the initial report load) the date passes without the timezone and returns the correct information. Example, running the report today (3rd September), the default parameter passes the value (info from profiler)         <Parameter>           <Name>vdtmDate</Name>           <Value xsi:type="xsd:dateTime">2010-09-02T00:00:00+

is the overarchitecting of a solution a major problem in the development world today.

Hello all,I have been on this project for a while and wanted to get your thoughts.I have been working on a Sharepoint solution for a while to create a ASP .Net feature in Visual Studio. Now this is your standard CRUD application that queries data, displays data, updates data etc.As I am proceeding to code in this the original developer has used quite a few patterns MVP, observer, commands, repository and a couple of others. Being that this is Sharepoint developement and integration with Sharepoint is not good at all, I am finding that to much time is spent managing facets of the patterns rather than actually finishing the app. Another point is that debugging a Sharepont app with VS2008 is a pain because I have to redeploy the app everytime to make sure my changes worked.My chief concern is that its taking me going through about5 hours, 8 different objects having to redeploy the app to sharepoint over 10 times to test my code just to populate a couple of grids and comboboxes. It just seems more efficient use of my time program this app just seperating out my data access and business logic layers and calling the them from my code behind in my ASP .Net pages. It just seemed like he used the patterns just to use them without understanding why they are needed or a patterns proper place in an app..What do you guys think?

How to Compare Text Column with Today Calculation in view?


I  have 2 columns

Birth Date (DateTime), Birth-Month(Text- Calculated from Birth Date with MONTH([Birth Date]))

Now I want to know who's birthday in this running month?

So How can I implement filter or CAML Query for a view.


Regards, Kashyap Patel http://interview-question-aspnet.blogspot.com/

CAML query to pick docs where modified is older than today.


Hi I am looking for a CAML query which will return all documents throughout the site collection
for docs which have a Modified that have past today.
I cant seem to do this.

I have a query so far as this and it comes up with an error 'The property Query contains invalid value'

SPSiteDataQuery q = new SPSiteDataQuery();
q.ViewFields = "<FieldRef Name=\"Modified\"/>";
q.Lists = "<Lists ServerTemplate=\"101\"/>";
q.Webs = "<Webs Scope=\"SiteCollection\"/>";
q.Query = "<where><Geq><FieldRef Name='Modified' /><Value Type='DateTime'><Today OffsetDays='-1' /></Value></Geq></where>";

How do you do this ??

I am about to get this job but SQL interview questions for tomorrow.

I have a job interview tomorrow, but they may ask me some questions about SQL but very basic troubleshooting knowledge. Rest of other questions are networking or tcp/ip.
Please let me know if you feel like you can help me.
Of course I've looked at google but it seems to be too much information.

1. at least 5 things to check if SQL isn't functioning.
2. where to check the logs.
3. how to perform a simple query to see if the DB is responding.

Thank you a mil.

Getting records that 7 days pass today's date


I want to get all records that are 7 days pass today's date and not equal to today's date.  Don't know how to write it so I can get records 7 days old but with this procedure I'm still getting records that are due today.  Hope this makes sense.  Can someone assist me.

select * from libraryrequest
where  duedate > getdate() and duedate != getdate()

Get Today's Events from A Calendar That Contains Multi-Day Events as Well as Recurring Events


I'm having trouble getting a list of today's events from a default calendar.

I've tried the following two CAML queries:

 <FieldRef Name=\"EventDate\" />
 <FieldRef Name=\"EndDate\" />
 <FieldRef Name=\"RecurrenceID\" />
 <Value Type=\"DateTime\"><Month /></Value>

Which resulted in the following Exception:

    One or more field types are not installed properly. Go to the list settings page to delete these fields.0x81020014

The calendar list is a default calendar list ie. no additional fields and no changes to the Eve

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend