Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. A domain error occurred in SQL

A domain error occurred in SQL

Scheduled Pinned Locked Moved Database
helpdatabasetutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Eunice VB junior
    wrote on last edited by
    #1

    Hi, I'm facing this problem which i don't know how to solve it. Can anyone guide me? I have a list of data in table @tmp1. Format like below. This table consists > 100 rows of data. Format: PartID PartNumber Yield 866 A100 0.98154735437972429 866 A100 0.9997734994337486 866 A100 0.99168797953964194 868 A200 0.70783730158730163 868 A200 0.99929971988795518 868 A200 0.99889908256880733 When i run this query, select partid,partnumber,convert(float,exp(sum(log(yield)))) from @tmp1 group by partid,partnumber Error encountered.Error message is "A domain error occurred". I'm trying to multiply all data from 'Yield' column. That's why i query with convert(float,exp(sum(log(yield)))) But I suspect convert(float,exp(sum(log(yield)))) is giving the error. So I tried to change datatype to int or varchar or decimal. But still cannot be solved. Pls help me. Thanks in advance.

    K 1 Reply Last reply
    0
    • E Eunice VB junior

      Hi, I'm facing this problem which i don't know how to solve it. Can anyone guide me? I have a list of data in table @tmp1. Format like below. This table consists > 100 rows of data. Format: PartID PartNumber Yield 866 A100 0.98154735437972429 866 A100 0.9997734994337486 866 A100 0.99168797953964194 868 A200 0.70783730158730163 868 A200 0.99929971988795518 868 A200 0.99889908256880733 When i run this query, select partid,partnumber,convert(float,exp(sum(log(yield)))) from @tmp1 group by partid,partnumber Error encountered.Error message is "A domain error occurred". I'm trying to multiply all data from 'Yield' column. That's why i query with convert(float,exp(sum(log(yield)))) But I suspect convert(float,exp(sum(log(yield)))) is giving the error. So I tried to change datatype to int or varchar or decimal. But still cannot be solved. Pls help me. Thanks in advance.

      K Offline
      K Offline
      Krish KP
      wrote on last edited by
      #2

      Check whether column yield contains any -ve value this might result in domain error

      Regards KP

      E 1 Reply Last reply
      0
      • K Krish KP

        Check whether column yield contains any -ve value this might result in domain error

        Regards KP

        E Offline
        E Offline
        Eunice VB junior
        wrote on last edited by
        #3

        It contains zero value. But don't have -ve value. How can i multiply all data when there is zero value? still convert(float,exp(sum(log(yield)))) ?? Can you please help to guide me? Thanks.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups