How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Satchi Your Own Question

Satchi
Satchi, Consultant
Category: Programming
Satisfied Customers: 2248
Experience:  C# SQLServer Oracle11gR2 .net 4.0 ASP.Net VisualStudio 2010 HTML JAVAScript
18133961
Type Your Programming Question Here...
Satchi is online now
A new question is answered every 9 seconds

1.Write a SELECT statement that returns four columns based

Resolved Question:

1.Write a SELECT statement that returns four columns based on the InvoiceTotal column of the Invoices table:
•Use the CAST function to return the first column as data type decimal with 2 digits to the right of the decimal point.
•Use CAST to return the second column as a varchar.
•Use the CONVERT function to return the third column as the same data type as the first column.
•Use CONVERT to return the fourth column as a varchar, using style 1.

2.Write a SELECT statement that returns four columns based on the InvoiceDate column of the Invoices table:
•Use the CAST function to return the first column as data type varchar.
•Use the CONVERT function to return the second and third columns as a varchar, using style 1 and style 10, respectively.
•Use the CAST function to return the fourth column as data type real.

3.Write a SELECT statement that returns two columns based on the Vendors table. The first column, Contact, is the vendor contact name
in this format: first name followed by last initial (for example, “John S.”) The second column, Phone, is the VendorPhone column without the area code.
Only return rows for those vendors in the 559 area code. Sort the result set by first name, then last name.

4.Write a SELECT statement that returns the InvoiceNumber and balance due for every invoice with a non-zero balance
and an InvoiceDueDate that’s less than 30 days from today.

5.Modify the search expression for InvoiceDueDate from the solution for exercise 4.
Rather than 30 days from today, return invoices due before the last day of the current month.

Here are the files.
http://wikisend.com/download/163200/SQL Diagram.docx
http://wikisend.com/download/456316/sql8_allfiles.zip
Submitted: 2 years ago.
Category: Programming
Expert:  Satchi replied 2 years ago.

Satchi :

Hi Welcome to Justanswer, I will be more than happy to assist you with your issue.

Satchi :

Please give me one day time

Satchi :

I am currently very busy and will be able to help you tomorrow...

Customer:

I need it by 1 pm. Is that going to be a problem?

Customer:

Are you going to be able to answer it by then?

Satchi :

let me work on it tonight then

Customer:

OK, I will check back in the morning to see if it's completed. Thank you.

Satchi :

yeah its my 11:22 PM now

Satchi :

feeeling sleepy...

Satchi :

:(

Satchi :

I will send you whatever I can tonight

Customer:

same here, we must be in the same time zone

Satchi :

yeah..

Satchi :

I am in Florida

Customer:

same

Satchi :

I am in Jupiter-33458

Customer:

Jacksonville- 32218

Satchi :

ok

Satchi :

there you go

Satchi :

the Last one is taking more time...

Satchi :

1.Write a SELECT statement that returns four columns based on the InvoiceTotal column of the Invoices table: •Use the CAST function to return the first column as data type decimal with 2 digits to the right of the decimal point. •Use CAST to return the second column as a varchar. •Use the CONVERT function to return the third column as the same data type as the first column. •Use CONVERT to return the fourth column as a varchar, using style 1.


select
cast(invoicetotal as decimal) as Column1 ,
cast(invoicetotal as varchar) as Column2,
convert(decimal,invoicetotal) as column3,
convert(Varchar,invoicetotal) as column4
from invoices ;


Unable to convert decimal from type money.Overflow.


 



2.Write a SELECT statement that returns four columns based on the InvoiceDate column of the Invoices table: •Use the CAST function to return the first column as data type varchar. •Use the CONVERT function to return the second and third columns as a varchar, using style 1 and style 10, respectively. •Use the CAST function to return the fourth column as data type real.

select
cast(invoicedate as varchar) as column1,
Convert(varchar,invoicedate, 1) as column2,
Convert(varchar,invoicedate ,10) as column3,
cast(invoicedate as real) as column4
from invoices


 


3.Write a SELECT statement that returns two columns based on the Vendors table. The first column, Contact, is the vendor contact name in this format: first name followed by last initial (for example, “John S.”) The second column, Phone, is the VendorPhone column without the area code. Only return rows for those vendors in the 559 area code. Sort the result set by first name, then last name.


select
(vendorcontactfname+' '+vendorcontactLname) as contact,
substring(vendorphone,6,15) as phone
from vendors
where patindex('%559%',substring(vendorphone,1,5))>0
order by vendorcontactfname,vendorcontactLname



4.Write a SELECT statement that returns the InvoiceNumber and balance due for every invoice with a non-zero balance and an InvoiceDueDate that’s less than 30 days from today.


select * from invoices where credittotal>0 and (datediff(day, getdate(),invoiceduedate) >30)


 


5.Modify the search expression for InvoiceDueDate from the solution for exercise 4. Rather than 30 days from today, return invoices due before the last day of the current month. Here are the files.


 

Satchi :

not sure if I can complete it by tomorrow

Customer:

I figured out the last one. Thank you for your help.

Satchi, Consultant
Category: Programming
Satisfied Customers: 2248
Experience: C# SQLServer Oracle11gR2 .net 4.0 ASP.Net VisualStudio 2010 HTML JAVAScript
Satchi and 2 other Programming Specialists are ready to help you

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
< Last | Next >
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
 
 
 

Meet The Experts:

 
 
 
  • ATLPROG

    Computer Software Engineer

    Satisfied Customers:

    7463
    MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
< Last | Next >
  • http://ww2.justanswer.com/uploads/SP/spatlanta2010/2011-6-23_12450_photo.64x64.gif ATLPROG's Avatar

    ATLPROG

    Computer Software Engineer

    Satisfied Customers:

    7463
    MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Computer Software Engineer

    Satisfied Customers:

    5603
    Expert in C, C++, Java, DOT NET, Python, HTML, Javascript, Design.
  • http://ww2.justanswer.com/uploads/unvadim/2010-11-15_210218_avatar.jpg unvadim's Avatar

    unvadim

    Computer Software Engineer

    Satisfied Customers:

    1158
    Good knowledge of OOP principles. 3+ years of programming experience with Java and C++. Sun Certified Java Programmer 5.0.
  • http://ww2.justanswer.com/uploads/lifesaver333/2010-10-17_191349_ls.jpeg lifesaver's Avatar

    lifesaver

    Computer Software Engineer

    Satisfied Customers:

    950
    Several years of intensive programming and application development experience in various platforms.
  • http://ww2.justanswer.com/uploads/EH/ehabtutor/2012-8-2_202016_1.64x64.jpg ehabtutor's Avatar

    ehabtutor

    Computer Software Engineer

    Satisfied Customers:

    864
    Bachelor of computer science, 5+ years experience in software development, software company owner
  • http://ww2.justanswer.com/uploads/RA/rajivsharma086/2012-6-6_17128_displaypic.64x64.jpg Raj's Avatar

    Raj

    Computer Engg.

    Satisfied Customers:

    860
    BE CS, 4+ Experience in Programming and Database (ERP)
  • http://ww2.justanswer.com/uploads/eljonis/2010-01-06_130406_eljon2.jpg Eljon's Avatar

    Eljon

    Consultant

    Satisfied Customers:

    590
    11 yrs of programming (PHP, WordPress, XSL, SQL, JavaScript)